From: Marek Polacek Date: Sat, 1 Dec 2018 21:32:16 +0000 (+0000) Subject: re PR c++/79629 (ICE on invalid code in tsubst_copy, at cp/pt.c:14477) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16e48dd1b41d4d99a3f0b576a8e3448a69ad5bbf;p=gcc.git re PR c++/79629 (ICE on invalid code in tsubst_copy, at cp/pt.c:14477) PR c++/79629 * g++.dg/other/error35.C: New test. From-SVN: r266712 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7afb2b71c2..9dfc58d4d68 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -37,6 +37,9 @@ PR c++/83856 * g++.dg/cpp1y/lambda-generic-83856.C: New test. + PR c++/79629 + * g++.dg/other/error35.C: New test. + 2018-12-01 Jeff Law * gcc.dg/predict-22.c: Update expected output. diff --git a/gcc/testsuite/g++.dg/other/error35.C b/gcc/testsuite/g++.dg/other/error35.C new file mode 100644 index 00000000000..e9c8371f18b --- /dev/null +++ b/gcc/testsuite/g++.dg/other/error35.C @@ -0,0 +1,14 @@ +// 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; } // { dg-error "not declared" } +static_assert(S().g() == 1, ""); // { dg-error "" } +// { dg-message "in .constexpr. expansion of" "" { target *-*-* } .-1 }