// PR c++/79629 // { dg-do compile { target c++14 } } // { dg-options "-w" } template struct S { enum E : int; constexpr int g() const; }; enum S::E; template enum S::E : int { b }; template constexpr int S::g() const { b; if (false) return 0; } // { dg-error "not declared" } static_assert(S().g() == 1, ""); // { dg-error "" } // { dg-message "in .constexpr. expansion of" "" { target *-*-* } .-1 }