aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-06-05 13:30:57 -0400
committerJason Merrill <jason@gcc.gnu.org>2014-06-05 13:30:57 -0400
commitda4e26be993775444e460edd68c88a1ae6a6a16e (patch)
treed38a72aaea9674c2e88e05164e4b318276ef8d2d /gcc
parentf0f2f975ac40291d471dd1453f6f89512fc22927 (diff)
downloadgcc-da4e26be993775444e460edd68c88a1ae6a6a16e.zip
gcc-da4e26be993775444e460edd68c88a1ae6a6a16e.tar.gz
gcc-da4e26be993775444e460edd68c88a1ae6a6a16e.tar.bz2
parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note for noexcept and thread_local, too.
* parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note for noexcept and thread_local, too. From-SVN: r211285
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/parser.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e9ea46d..1248ea1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2014-06-04 Jason Merrill <jason@redhat.com>
+ * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
+ for noexcept and thread_local, too.
+
PR c++/61343
* decl.c (check_initializer): Maybe clear
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 60e6cda..7d574d0 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2920,6 +2920,13 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser,
if (cxx_dialect < cxx11 && id == ridpointers[(int)RID_CONSTEXPR])
inform (location, "C++11 %<constexpr%> only available with "
"-std=c++11 or -std=gnu++11");
+ else if (cxx_dialect < cxx11 && id == ridpointers[(int)RID_NOEXCEPT])
+ inform (location, "C++11 %<noexcept%> only available with "
+ "-std=c++11 or -std=gnu++11");
+ else if (cxx_dialect < cxx11
+ && !strcmp (IDENTIFIER_POINTER (id), "thread_local"))
+ inform (location, "C++11 %<thread_local%> only available with "
+ "-std=c++11 or -std=gnu++11");
else if (processing_template_decl && current_class_type
&& TYPE_BINFO (current_class_type))
{