[C++] PR43824 pedantic with inline namespaces

Submitted by Rodrigo Rivas on July 26, 2010, 11:08 p.m.

Details

Message ID 1280185724.5689.2.camel@abajo
State New
Headers show

Commit Message

Rodrigo Rivas July 26, 2010, 11:08 p.m.
Hello. 
The following patch adds the pedantic warning to inline namespaces if
the compiler is not in C++0x mode, as commented in PR43824.

Regards.
--
Rodrigo.

Comments

Jason Merrill Aug. 18, 2010, 10:16 p.m.
On 07/26/2010 07:08 PM, Rodrigo wrote:
> The following patch adds the pedantic warning to inline namespaces if
> the compiler is not in C++0x mode, as commented in PR43824.

I'd prefer to add this warning to maybe_warn_cxx0x and then just call 
that function here.

Thanks,
Jason

Patch hide | download patch | download mbox

Index: parser.c
===================================================================
--- parser.c	(revision: 162531)
+++ parser.c	(copia de trabajo)
@@ -13210,6 +13210,9 @@  cp_parser_namespace_definition (cp_parse
 
   if (cp_lexer_next_token_is_keyword (parser->lexer, RID_INLINE))
     {
+      if (cxx_dialect < cxx0x && !in_system_header)
+	pedwarn (input_location, OPT_pedantic, 
+		   "ISO C++98 does not allow inline namespaces");
       is_inline = true;
       cp_lexer_consume_token (parser->lexer);
     }