Skip to content

[clang] Crash instantiating static variable template specialization member of class template #135032

Open
@katzdm

Description

@katzdm

The following program crashes during codegen, and looks to have done so since Clang 9.

template <typename>
struct TCls {
  template <typename T>
  static auto var = T::smem;
};

struct S { static constexpr int smem = 1; };

int main() {
  (void) TCls<int>::var<S>;
}

https://godbolt.org/z/x9eYMKfrv

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions