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
This commit is contained in:
Jason Merrill 2014-06-05 13:30:57 -04:00 committed by Jason Merrill
parent f0f2f975ac
commit da4e26be99
2 changed files with 10 additions and 0 deletions

View 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.

View 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))
{