"only available with %<-std=c++11%> or %<-std=gnu++11%>");
break;
case CPP0X_ATTRIBUTES:
- pedwarn (loc, OPT_Wc__11_extensions,
- "C++11 attributes "
- "only available with %<-std=c++11%> or %<-std=gnu++11%>");
+ if (pedantic)
+ pedwarn (loc, OPT_Wc__11_extensions,
+ "C++11 attributes "
+ "only available with %<-std=c++11%> or %<-std=gnu++11%>");
break;
case CPP0X_REF_QUALIFIER:
pedwarn (loc, OPT_Wc__11_extensions,
{
cp_token *token = cp_lexer_peek_nth_token (parser->lexer, n);
- return (cxx_dialect >= cxx11
- && ((token->type == CPP_KEYWORD && token->keyword == RID_ALIGNAS)
- || (token->type == CPP_OPEN_SQUARE
- && (token = cp_lexer_peek_nth_token (parser->lexer, n + 1))
- && token->type == CPP_OPEN_SQUARE)));
+ return ((token->type == CPP_KEYWORD && token->keyword == RID_ALIGNAS)
+ || (token->type == CPP_OPEN_SQUARE
+ && (token = cp_lexer_peek_nth_token (parser->lexer, n + 1))
+ && token->type == CPP_OPEN_SQUARE));
}
/* Return TRUE iff the next Nth tokens in the stream are possibly the
-// { dg-do compile { target c++11 } }
+// { dg-additional-options "-Wno-c++11-extensions" }
int **** [[gnu::format(printf, 1, 2)]] foo(const char *, ...); // { dg-warning "only applies to function types" }
-// { dg-do compile { target c++11 } }
+// { dg-additional-options "-Wno-c++11-extensions" }
// PR c++/13791
template <typename T> struct O {
-// { dg-do compile { target c++11 } }
+// { dg-additional-options "-Wno-c++11-extensions" }
// PR c++/13854
extern char *rindex [[gnu::__pure__]] (__const char *__s, int __c) throw ();
-// { dg-do compile { target c++11 } }
+// { dg-additional-options "-Wno-c++11-extensions" }
// PR c++/15317
struct A
// PR c++/101582
// { dg-do compile }
-// { dg-options "" }
+// { dg-options "-pedantic -Wno-extra-semi" }
;
[[]] [[]] [[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
extern "C" extern "C" ;
extern "C" extern "C" [[]][[]][[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
__extension__ ;
-__extension__ [[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
+__extension__ [[]];
__extension__ __extension__ ;
-__extension__ __extension__ [[]][[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
+__extension__ __extension__ [[]][[]];
namespace N {
extern "C" extern "C" ;
extern "C" extern "C" [[]][[]][[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
__extension__ ;
-__extension__ [[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
+__extension__ [[]];
__extension__ __extension__ ;
-__extension__ __extension__ [[]][[]]; // { dg-warning "attributes only available with" "" { target c++98_only } }
+__extension__ __extension__ [[]][[]];
}