Skip to content

Static member auto variable template with template-template parameter, inside struct with template-template parameter, crashes compiler #49085

Open
@Matthewacon

Description

@Matthewacon
Bugzilla Link 49741
Version unspecified
OS Linux
Attachments Compiler crash backtrace, Run script
CC @zygoloid

Extended Description

See attachment for compiler backtrace.

Affected versions:

  • trunk
  • 11.0.1
  • 11.0.0
  • 10.0.1
  • 10.0.0
  • 9.0.1
  • 9.0.0

Driver cmdline:
Note: For versions that do not support -std=c++20, -std=c++2a was used.

clang++ -Xclang -disable-llvm-passes -std=c++20

Note: The original code has been reduced with creduce.
Reduced code:

template <template <typename> typename> struct a {
  template <template <typename> typename> static auto const b = false;
};
template <typename> struct c;
int main() { a<c>::b<c>; }


Original code:

template<template<typename...> typename T>
struct Receiver {
 template<template<typename...> typename Other>
 static constexpr auto const value = false;
};

template<typename...>
struct A;

void f(auto) {}

int main() {
 f(Receiver<A>::value<A>);
 return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:codegenIR generation bugs: mangling, exceptions, etc.confirmedVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions