diff mbox

C++ PATCHes for C++14 testsuite regressions

Message ID 531A24A7.6020903@redhat.com
State New
Headers show

Commit Message

Jason Merrill March 7, 2014, 7:57 p.m. UTC
These patches address regressions revealed by my work to run the 
testsuite in C++14 mode.

The first patch addresses multiple failures caused by force_paren_expr 
wrapping simple expressions so that decltype(auto) will treat them 
differently.  The static_cast to reference trick was breaking bitfields, 
so I've switched to setting a flag on the COMPONENT_REF instead.  And 
then I stopped doing the wrapping in unevaluated context to address 
problems with addressof.

The second patch fixes an ICE on auto11.C due to confusion between 
'auto' and 'T'.

The third patch fixes many missed errors in auto9.C.

The fourth patch harmonizes the default VLA warning level in C++14 mode 
with C++98/11: now we mostly won't get warnings about VLAs with 
-std=gnu++1y, but we will with -std=c++1y or with -Wvla.  It also fixes 
the text of a pedwarn in build_new to be more helpful.

The last patch applies to C++11 mode as well; running vt-34051 with 
-pedantic-errors was producing a spurious extra semicolon pedwarn.

Tested x86_64-pc-linux-gnu, applying to trunk.
diff mbox

Patch

commit fdf7f71e757340ea3eca836b5fa42e4faee36e13
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 7 09:55:58 2014 -0500

    	* parser.c (cp_parser_using_declaration): Consume the semicolon
    	after bare parameter pack error.

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 8bc1126..71a2a9e 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -16016,7 +16016,10 @@  cp_parser_using_declaration (cp_parser* parser,
 	    USING_DECL_TYPENAME_P (decl) = 1;
 
 	  if (check_for_bare_parameter_packs (decl))
-            return false;
+	    {
+	      cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
+	      return false;
+	    }
 	  else
 	    /* Add it to the list of members in this class.  */
 	    finish_member_declaration (decl);
@@ -16031,7 +16034,10 @@  cp_parser_using_declaration (cp_parser* parser,
 					 decl, NLE_NULL,
 					 token->location);
 	  else if (check_for_bare_parameter_packs (decl))
-	    return false;
+	    {
+	      cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
+	      return false;
+	    }
 	  else if (!at_namespace_scope_p ())
 	    do_local_using_decl (decl, qscope, identifier);
 	  else