public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] C++ PATCH to add test for c++/79629
@ 2018-12-01 22:01 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2018-12-01 22:01 UTC (permalink / raw)
  To: GCC Patches

Tested x86_64-linux, applying to trunk.

2018-12-01  Marek Polacek  <polacek@redhat.com>

	PR c++/79629
	* g++.dg/other/error35.C: New test.

diff --git gcc/testsuite/g++.dg/other/error35.C gcc/testsuite/g++.dg/other/error35.C
new file mode 100644
index 00000000000..e9c8371f18b
--- /dev/null
+++ 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 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-01 22:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-01 22:01 [committed] C++ PATCH to add test for c++/79629 Marek Polacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).