parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note for noexcept and...
authorJason Merrill <jason@redhat.com>
Thu, 5 Jun 2014 17:30:57 +0000 (13:30 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 5 Jun 2014 17:30:57 +0000 (13:30 -0400)
* parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
for noexcept and thread_local, too.

From-SVN: r211285

gcc/cp/ChangeLog
gcc/cp/parser.c

index e9ea46d7d90bc518debb330ca35b5732f072d3a2..1248ea12fbe4e6f1e7e3eeeb4a6e26fd6315f98a 100644 (file)
@@ -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.
index 60e6cda98a42a5d341db28683380831dd7e9bd2e..7d574d0d3f1d94fcb670043c8facd51610d34e1d 100644 (file)
@@ -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))
        {