xref: /llvm-project/clang/test/SemaCXX/PR86790.cpp (revision cfb86ae7497e43e9221ab890221789ae320381e9)
1 // RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s
2 
3 enum {A, S, D, F};
main()4 int main() {
5     using asdf = decltype(A);
6     using enum asdf; // this line causes the crash
7     return 0;
8 }
9 
10 namespace N1 {
11     enum {A, S, D, F};
12     constexpr struct T {
13     using asdf = decltype(A);
14     using enum asdf;
15     } t;
16 
17     static_assert(t.D == D);
18     static_assert(T::S == S);
19 }
20 
21 namespace N2 {
22     enum {A, S, D, F};
23     constexpr struct T {
24     struct {
25         using asdf = decltype(A);
26         using enum asdf;
27     } inner;
28     } t;
29 
30     static_assert(t.inner.D == D);
31     static_assert(t.D == D); // expected-error {{no member named 'D' in 'N2::T'}}
32 }
33