diff options
author | Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> | 2010-09-10 18:28:59 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-09-10 14:28:59 -0400 |
commit | bc2c4cb45ec9f5ad78cbe21711f053c22c41a29b (patch) | |
tree | afe3ceb11522d0b0045fcf2f72563bfbc3c42dc8 /gcc/cp | |
parent | 4c26f0a5a296f356afe3da2d0536d166f817b221 (diff) | |
download | gcc-bc2c4cb45ec9f5ad78cbe21711f053c22c41a29b.zip gcc-bc2c4cb45ec9f5ad78cbe21711f053c22c41a29b.tar.gz gcc-bc2c4cb45ec9f5ad78cbe21711f053c22c41a29b.tar.bz2 |
re PR c++/43824 (C++0x feature "inline namespace" enabled under -std=c++98; no warnings)
PR c++/43824
* error.c (maybe_warn_cpp0x): Add new warning
CPP0X_INLINE_NAMESPACES.
* parser.c (cp_parser_namespace_definition): Likewise.
* cp-tree.h (cpp0x_warn_str): Likewise.
From-SVN: r164201
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 4 | ||||
-rw-r--r-- | gcc/cp/error.c | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 1 |
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a5d46a8..5c58733 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> + + PR c++/43824 + * error.c (maybe_warn_cpp0x): Add new warning + CPP0X_INLINE_NAMESPACES. + * parser.c (cp_parser_namespace_definition): Likewise. + * cp-tree.h (cpp0x_warn_str): Likewise. + 2010-09-10 Richard Guenther <rguenther@suse.de> * decl.c (reshape_init_vector): For VECTOR_TYPEs, use diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index cb3b55f..bf8017e 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -387,7 +387,9 @@ typedef enum cpp0x_warn_str /* scoped enums */ CPP0X_SCOPED_ENUMS, /* defaulted and deleted functions */ - CPP0X_DEFAULTED_DELETED + CPP0X_DEFAULTED_DELETED, + /* inline namespaces */ + CPP0X_INLINE_NAMESPACES } cpp0x_warn_str; /* The various kinds of operation used by composite_pointer_type. */ diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 2bcc35b..981b71f 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -3028,6 +3028,11 @@ maybe_warn_cpp0x (cpp0x_warn_str str) pedwarn (input_location, 0, "defaulted and deleted functions " "only available with -std=c++0x or -std=gnu++0x"); + break; + case CPP0X_INLINE_NAMESPACES: + pedwarn (input_location, OPT_pedantic, + "inline namespaces " + "only available with -std=c++0x or -std=gnu++0x"); break; default: gcc_unreachable(); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8faf21d..3f2c4de 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -13255,6 +13255,7 @@ cp_parser_namespace_definition (cp_parser* parser) if (cp_lexer_next_token_is_keyword (parser->lexer, RID_INLINE)) { + maybe_warn_cpp0x (CPP0X_INLINE_NAMESPACES); is_inline = true; cp_lexer_consume_token (parser->lexer); } |