aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2018-12-01 21:32:16 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2018-12-01 21:32:16 +0000
commit16e48dd1b41d4d99a3f0b576a8e3448a69ad5bbf (patch)
tree7e6dd65b7ecf314175886f403b035d9f310bb382
parent8fc1ef712dfc1ae506eea6726448d900eb9b6cf4 (diff)
downloadgcc-16e48dd1b41d4d99a3f0b576a8e3448a69ad5bbf.zip
gcc-16e48dd1b41d4d99a3f0b576a8e3448a69ad5bbf.tar.gz
gcc-16e48dd1b41d4d99a3f0b576a8e3448a69ad5bbf.tar.bz2
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
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/other/error35.C14
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c7afb2b..9dfc58d 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 <law@redhat.com>
* 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 0000000..e9c8371
--- /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 <typename> struct S {
+ enum E : int;
+ constexpr int g() const;
+};
+enum S<char>::E;
+template <typename T> enum S<T>::E : int { b };
+template <typename T>
+constexpr int S<T>::g() const { b; } // { dg-error "not declared" }
+static_assert(S<char>().g() == 1, ""); // { dg-error "" }
+// { dg-message "in .constexpr. expansion of" "" { target *-*-* } .-1 }