33 lines · cpp
1// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s2 3enum {A, S, D, F};4int main() {5 using asdf = decltype(A);6 using enum asdf; // this line causes the crash7 return 0;8}9 10namespace 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 21namespace 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