From: Marek Polacek <polacek@redhat.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [committed] C++ PATCH to add test for c++/79629
Date: Sat, 01 Dec 2018 22:01:00 -0000 [thread overview]
Message-ID: <20181201220159.GE21364@redhat.com> (raw)
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 }
reply other threads:[~2018-12-01 22:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181201220159.GE21364@redhat.com \
--to=polacek@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).