===================================================================
@@ -1,5 +1,6 @@
// PR c++/13594 (secondary)
+// { dg-options "" }
// { dg-do compile }
namespace fool {
===================================================================
@@ -1,5 +1,7 @@
// PR c++/33486
+// { dg-options "" }
+
namespace A
{
inline namespace B
===================================================================
@@ -1,5 +1,6 @@
// PR c++/13594
+// { dg-options "" }
// { dg-do compile }
namespace foo {
===================================================================
@@ -1,5 +1,6 @@
// PR c++/13659
+// { dg-options "" }
// { dg-do compile }
namespace bar {
===================================================================
@@ -1,3 +1,5 @@
+// { dg-options -std=c++0x }
+
namespace C
{
void f();
===================================================================
@@ -0,0 +1,2 @@
+// { dg-options "-std=gnu++98 -pedantic" }
+inline namespace { } // { dg-warning "inline namespaces" }
===================================================================
@@ -0,0 +1,2 @@
+// { dg-options "-std=gnu++98 -pedantic-errors" }
+inline namespace { } // { dg-error "inline namespaces" }
===================================================================
@@ -3029,6 +3029,11 @@ maybe_warn_cpp0x (cpp0x_warn_str str)
"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();
}
===================================================================
@@ -13246,6 +13467,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);
}
===================================================================
@@ -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. */