Patchwork [C++] PR43824 pedantic with inline namespaces

login
register
mail settings
Submitter Rodrigo Rivas
Date July 26, 2010, 11:08 p.m.
Message ID <1280185724.5689.2.camel@abajo>
Download mbox | patch
Permalink /patch/59956/
State New
Headers show

Comments

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

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);
     }