Switch diagnostic text from "C++0x" over to "C++11".

We'd also like for "C++11" or "c++11" to be used for the warning
groups, but without removing the old warning flags. Patches welcome;
I've run out of time to work on this today.

llvm-svn: 141801
This commit is contained in:
Douglas Gregor 2011-10-12 19:26:40 +00:00
parent de2ff3b64e
commit 205d044552
26 changed files with 91 additions and 91 deletions

View File

@ -52,7 +52,7 @@ def err_invalid_storage_class_in_func_decl : Error<
"invalid storage class specifier in function declarator">;
def err_expected_namespace_name : Error<"expected namespace name">;
def ext_variadic_templates : ExtWarn<
"variadic templates are a C++0x extension">, InGroup<CXX0x>;
"variadic templates are a C++11 extension">, InGroup<CXX0x>;
def err_default_special_members : Error<
"only special member functions may be defaulted">;
def err_friends_define_only_namespace_scope : Error<

View File

@ -302,7 +302,7 @@ def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
def NonGCC : DiagGroup<"non-gcc",
[SignCompare, Conversion, LiteralRange]>;
// A warning group for warnings about using C++0x features as extensions in
// A warning group for warnings about using C++11 features as extensions in
// earlier C++ versions.
def CXX0x : DiagGroup<"c++0x-extensions">;
def DelegatingCtorCycles :

View File

@ -53,7 +53,7 @@ def ext_c99_variable_decl_in_for_loop : Extension<
def ext_c99_compound_literal : Extension<
"compound literals are a C99-specific feature">;
def ext_enumerator_list_comma : Extension<
"commas at the end of enumerator lists are a %select{C99|C++0x}0-specific "
"commas at the end of enumerator lists are a %select{C99|C++11}0-specific "
"feature">;
def err_enumerator_list_missing_comma : Error<
"missing ',' between enumerators">;
@ -187,26 +187,26 @@ def err_invalid_reference_qualifier_application : Error<
def err_illegal_decl_reference_to_reference : Error<
"%0 declared as a reference to a reference">;
def ext_rvalue_reference : ExtWarn<
"rvalue references are a C++0x extension">, InGroup<CXX0x>;
"rvalue references are a C++11 extension">, InGroup<CXX0x>;
def ext_ref_qualifier : ExtWarn<
"reference qualifiers on functions are a C++0x extension">, InGroup<CXX0x>;
"reference qualifiers on functions are a C++11 extension">, InGroup<CXX0x>;
def ext_inline_namespace : ExtWarn<
"inline namespaces are a C++0x feature">, InGroup<CXX0x>;
"inline namespaces are a C++11 feature">, InGroup<CXX0x>;
def err_generalized_initializer_lists : Error<
"generalized initializer lists are a C++0x extension unsupported in Clang">;
"generalized initializer lists are a C++11 extension unsupported in Clang">;
def ext_generalized_initializer_lists : ExtWarn<
"generalized initializer lists are a C++0x extension unsupported in Clang">,
"generalized initializer lists are a C++11 extension unsupported in Clang">,
InGroup<CXX0x>;
def ext_auto_type_specifier : ExtWarn<
"'auto' type specifier is a C++0x extension">, InGroup<CXX0x>;
"'auto' type specifier is a C++11 extension">, InGroup<CXX0x>;
def warn_auto_storage_class : Warning<
"'auto' storage class specifier is redundant and incompatible with C++0x">,
"'auto' storage class specifier is redundant and incompatible with C++11">,
InGroup<CXX0xCompat>;
def ext_auto_storage_class : ExtWarn<
"'auto' storage class specifier is not permitted in C++0x, and will not "
"'auto' storage class specifier is not permitted in C++11, and will not "
"be supported in future releases">;
def ext_for_range : ExtWarn<
"range-based for loop is a C++0x extension">, InGroup<CXX0x>;
"range-based for loop is a C++11 extension">, InGroup<CXX0x>;
def err_argument_required_after_attribute : Error<
"argument required after attribute">;
def err_missing_param : Error<"expected parameter declarator">;
@ -372,9 +372,9 @@ def err_default_delete_in_multiple_declaration : Error<
"standalone declaration">;
def err_cxx0x_attribute_forbids_arguments : Error<
"C++0x attribute '%0' cannot have an argument list">;
"C++11 attribute '%0' cannot have an argument list">;
def err_cxx0x_attribute_requires_arguments : Error<
"C++0x attribute '%0' must have an argument list">;
"C++1 attribute '%0' must have an argument list">;
def err_attributes_not_allowed : Error<"an attribute list cannot appear here">;
/// C++ Templates
@ -399,7 +399,7 @@ def err_two_right_angle_brackets_need_space : Error<
"a space is required between consecutive right angle brackets (use '> >')">;
def warn_cxx0x_right_shift_in_template_arg : Warning<
"use of right-shift operator ('>>') in template argument will require "
"parentheses in C++0x">;
"parentheses in C++11">;
def err_multiple_template_declarators : Error<
"%select{|a template declaration|an explicit template specialization|"
"an explicit template instantiation}0 can "
@ -460,31 +460,31 @@ def err_missing_whitespace_digraph : Error<
" which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
def warn_deleted_function_accepted_as_extension: ExtWarn<
"deleted function definition accepted as a C++0x extension">, InGroup<CXX0x>;
"deleted function definition accepted as a C++11 extension">, InGroup<CXX0x>;
def warn_defaulted_function_accepted_as_extension: ExtWarn<
"defaulted function definition accepted as a C++0x extension">,
"defaulted function definition accepted as a C++11 extension">,
InGroup<CXX0x>;
// C++0x in-class member initialization
// C++11 in-class member initialization
def warn_nonstatic_member_init_accepted_as_extension: ExtWarn<
"in-class initialization of non-static data member accepted as a C++0x extension">,
"in-class initialization of non-static data member accepted as a C++11 extension">,
InGroup<CXX0x>;
def err_bitfield_member_init: Error<
"bitfield member cannot have an in-class initializer">;
def err_incomplete_array_member_init: Error<
"array bound cannot be deduced from an in-class initializer">;
// C++0x alias-declaration
// C++11 alias-declaration
def ext_alias_declaration : ExtWarn<
"alias declarations accepted as a C++0x extension">, InGroup<CXX0x>;
"alias declarations accepted as a C++11 extension">, InGroup<CXX0x>;
def err_alias_declaration_not_identifier : Error<
"name defined in alias declaration must be an identifier">;
def err_alias_declaration_specialization : Error<
"%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
// C++0x override control
// C++11 override control
def ext_override_control_keyword : Extension<
"'%0' keyword accepted as a C++0x extension">, InGroup<CXX0x>;
"'%0' keyword accepted as a C++11 extension">, InGroup<CXX0x>;
def err_duplicate_virt_specifier : Error<
"class member already marked '%0'">;
@ -501,7 +501,7 @@ def err_paren_sizeof_parameter_pack : Error<
def err_sizeof_parameter_pack : Error<
"expected parenthesized parameter pack name in 'sizeof...' expression">;
// C++0x lambda expressions
// C++11 lambda expressions
def err_expected_comma_or_rsquare : Error<
"expected ',' or ']' in lambda capture list">;
def err_this_captured_by_reference : Error<

View File

@ -618,12 +618,12 @@ def err_unexpected_friend : Error<
def ext_enum_friend : ExtWarn<
"enumeration type %0 cannot be a friend">;
def ext_nonclass_type_friend : ExtWarn<
"non-class friend type %0 is a C++0x extension">, InGroup<CXX0x>;
"non-class friend type %0 is a C++11 extension">, InGroup<CXX0x>;
def err_friend_is_member : Error<
"friends cannot be members of the declaring class">;
def ext_unelaborated_friend_type : ExtWarn<
"specify '%select{struct|union|class|enum}0' to befriend %1; accepted "
"as a C++0x extension">, InGroup<CXX0x>;
"as a C++11 extension">, InGroup<CXX0x>;
def err_qualified_friend_not_found : Error<
"no function named %0 with type %1 was found in the specified scope">;
def err_introducing_special_friend : Error<
@ -1076,11 +1076,11 @@ def err_temp_copy_deleted : Error<
def err_temp_copy_incomplete : Error<
"copying a temporary object of incomplete type %0">;
// C++0x decltype
// C++11 decltype
def err_cannot_determine_declared_type_of_overloaded_function : Error<
"cannot determine the type of an overloaded function">;
// C++0x auto
// C++11 auto
def err_auto_variable_cannot_appear_in_own_initializer : Error<
"variable %0 declared with 'auto' type cannot appear in its own initializer">;
def err_illegal_decl_array_of_auto : Error<
@ -1113,7 +1113,7 @@ def err_auto_new_deduction_failure : Error<
def err_auto_different_deductions : Error<
"'auto' deduced as %0 in declaration of %1 and deduced as %2 in declaration of %3">;
// C++0x override control
// C++11 override control
def override_keyword_only_allowed_on_virtual_member_functions : Error<
"only virtual member functions can be marked '%0'">;
def err_function_marked_override_not_overriding : Error<
@ -1121,16 +1121,16 @@ def err_function_marked_override_not_overriding : Error<
def err_class_marked_final_used_as_base : Error<
"base %0 is marked 'final'">;
// C++0x attributes
// C++11 attributes
def err_repeat_attribute : Error<"'%0' attribute cannot be repeated">;
// C++0x [[final]]
// C++11 [[final]]
def err_final_function_overridden : Error<
"declaration of %0 overrides a 'final' function">;
def err_final_base : Error<
"derivation from 'final' %0">;
// C++0x scoped enumerations
// C++11 scoped enumerations
def err_enum_invalid_underlying : Error<
"non-integral type %0 is an invalid underlying type">;
def err_enumerator_too_large : Error<
@ -1151,9 +1151,9 @@ def err_only_enums_have_underlying_types : Error<
def err_incomplete_type_no_underlying_type : Error<
"an incomplete enumeration type has no underlying type yet">;
// C++0x delegating constructors
// C++11 delegating constructors
def err_delegation_0x_only : Error<
"delegating constructors are permitted only in C++0x">;
"delegating constructors are permitted only in C++11">;
def err_delegating_initializer_alone : Error<
"an initializer for a delegating constructor must appear alone">;
def warn_delegating_ctor_cycle : Warning<
@ -1166,7 +1166,7 @@ def note_which_delegates_to : Note<
def err_delegating_codegen_not_implemented : Error<
"code generation for delegating constructors not implemented">;
// C++0x range-based for loop
// C++11 range-based for loop
def err_for_range_decl_must_be_var : Error<
"for range declaration must declare a variable">;
def err_for_range_storage_class : Error<
@ -1188,7 +1188,7 @@ def note_for_range_type : Note<"range has type %0">;
def note_for_range_begin_end : Note<
"selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">;
// C++0x constexpr
// C++11 constexpr
def err_invalid_constexpr : Error<
"%select{function parameter|typedef|non-static data member}0 "
"cannot be constexpr">;
@ -2050,7 +2050,7 @@ def note_template_param_prev_default_arg : Note<
def err_template_param_default_arg_missing : Error<
"template parameter missing a default argument">;
def ext_template_parameter_default_in_function_template : ExtWarn<
"default template arguments for a function template are a C++0x extension">,
"default template arguments for a function template are a C++11 extension">,
InGroup<CXX0x>;
def err_template_parameter_default_template_member : Error<
"cannot add a default template argument to the definition of a member of a "
@ -2187,7 +2187,7 @@ def err_template_spec_decl_out_of_scope_global : Error<
def ext_template_spec_decl_out_of_scope_global : ExtWarn<
"%select{class template|class template partial|function template|member "
"function|static data member|member class}0 specialization of %1 must "
"originally be declared in the global scope; accepted as a C++0x extension">,
"originally be declared in the global scope; accepted as a C++11 extension">,
InGroup<CXX0x>;
def err_template_spec_decl_out_of_scope : Error<
"%select{class template|class template partial|function template|member "
@ -2196,7 +2196,7 @@ def err_template_spec_decl_out_of_scope : Error<
def ext_template_spec_decl_out_of_scope : ExtWarn<
"%select{class template|class template partial|function template|member "
"function|static data member|member class}0 specialization of %1 must "
"originally be declared in namespace %2; accepted as a C++0x extension">,
"originally be declared in namespace %2; accepted as a C++11 extension">,
InGroup<CXX0x>;
def err_template_spec_redecl_out_of_scope : Error<
"%select{class template|class template partial|function template|member "
@ -2363,7 +2363,7 @@ def note_previous_explicit_instantiation : Note<
"previous explicit instantiation is here">;
def ext_explicit_instantiation_after_specialization : Extension<
"explicit instantiation of %0 that occurs after an explicit "
"specialization will be ignored (C++0x extension)">,
"specialization will be ignored (C++11 extension)">,
InGroup<CXX0x>;
def note_previous_template_specialization : Note<
"previous template specialization is here">;
@ -2468,7 +2468,7 @@ def note_template_declared_here : Note<
"%select{function template|class template|type alias template|template template parameter}0 "
"%1 declared here">;
// C++0x Variadic Templates
// C++11 Variadic Templates
def err_template_param_pack_default_arg : Error<
"template parameter pack cannot have a default argument">;
def err_template_param_pack_must_be_last_template_parameter : Error<
@ -2753,11 +2753,11 @@ def err_init_list_constant_narrowing : Error<
"constant expression evaluates to %0 which cannot be narrowed to type %1">;
def warn_init_list_variable_narrowing : Warning<
"non-constant-expression cannot be narrowed from type %0 to %1 in "
"initializer list in C++0x">,
"initializer list in C++11">,
InGroup<CXX0xNarrowing>, DefaultIgnore;
def warn_init_list_constant_narrowing : Warning<
"constant expression evaluates to %0 which cannot be narrowed to type %1 in "
"C++0x">,
"C++11">,
InGroup<CXX0xNarrowing>, DefaultIgnore;
def note_init_list_narrowing_override : Note<
"override this message by inserting an explicit cast">;
@ -3673,7 +3673,7 @@ def err_array_size_ambiguous_conversion : Error<
"enumeration type">;
def ext_array_size_conversion : Extension<
"implicit conversion from array size expression of type %0 to "
"%select{integral|enumeration}1 type %2 is a C++0x extension">,
"%select{integral|enumeration}1 type %2 is a C++11 extension">,
InGroup<CXX0x>;
def err_address_space_qualified_new : Error<
"'new' cannot allocate objects of type %0 in address space '%1'">;
@ -4376,11 +4376,11 @@ def warn_conv_to_void_not_used : Warning<
def warn_not_compound_assign : Warning<
"use of unary operator that may be intended as compound assignment (%0=)">;
// C++0x explicit conversion operators
// C++11 explicit conversion operators
def warn_explicit_conversion_functions : Warning<
"explicit conversion functions are a C++0x extension">, InGroup<CXX0x>;
"explicit conversion functions are a C++11 extension">, InGroup<CXX0x>;
// C++0x defaulted functions
// C++11 defaulted functions
def err_defaulted_default_ctor_params : Error<
"an explicitly-defaulted default constructor must have no parameters">;
def err_defaulted_copy_ctor_params : Error<

View File

@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
template<typename T>
class X0 {
friend T; // expected-warning{{non-class friend type 'T' is a C++0x extension}}
friend T; // expected-warning{{non-class friend type 'T' is a C++11 extension}}
};
class X1 { };

View File

@ -4,7 +4,7 @@ struct B0;
class A {
friend class B {}; // expected-error {{cannot define a type in a friend declaration}}
friend int; // expected-warning {{non-class friend type 'int' is a C++0x extension}}
friend int; // expected-warning {{non-class friend type 'int' is a C++11 extension}}
friend B0; // expected-warning {{specify 'struct' to befriend 'B0'}}
friend class C; // okay
};

View File

@ -3,7 +3,7 @@
class A {
friend static class B; // expected-error {{'static' is invalid in friend declarations}}
friend extern class C; // expected-error {{'extern' is invalid in friend declarations}}
friend auto class D; // expected-warning {{incompatible with C++0x}} expected-error {{'auto' is invalid in friend declarations}}
friend auto class D; // expected-warning {{incompatible with C++11}} expected-error {{'auto' is invalid in friend declarations}}
friend register class E; // expected-error {{'register' is invalid in friend declarations}}
friend mutable class F; // expected-error {{'mutable' is invalid in friend declarations}}
friend typedef class G; // expected-error {{'typedef' is invalid in friend declarations}}

View File

@ -4,7 +4,7 @@ class A {
public:
explicit A();
explicit operator int(); // expected-warning {{explicit conversion functions are a C++0x extension}}
explicit operator int(); // expected-warning {{explicit conversion functions are a C++11 extension}}
explicit void f0(); // expected-error {{'explicit' can only be applied to a constructor or conversion function}}
@ -12,5 +12,5 @@ public:
};
explicit A::A() { } // expected-error {{'explicit' can only be specified inside the class definition}}
explicit A::operator bool() { return false; } // expected-warning {{explicit conversion functions are a C++0x extension}}\
explicit A::operator bool() { return false; } // expected-warning {{explicit conversion functions are a C++11 extension}}\
// expected-error {{'explicit' can only be specified inside the class definition}}

View File

@ -9,4 +9,4 @@ X<X<X<X<int>> // expected-error{{a space is required between consecutive right a
>> *x3; // expected-error{{a space is required between consecutive right angle brackets (use '> >')}}
Y<(1 >> 2)> *y1;
Y<1 >> 2> *y2; // expected-warning{{use of right-shift operator ('>>') in template argument will require parentheses in C++0x}}
Y<1 >> 2> *y2; // expected-warning{{use of right-shift operator ('>>') in template argument will require parentheses in C++11}}

View File

@ -2,9 +2,9 @@
// A default template-argument shall not be specified in a function
// template declaration or a function template definition
template<typename T = int> // expected-warning{{default template arguments for a function template are a C++0x extension}}
template<typename T = int> // expected-warning{{default template arguments for a function template are a C++11 extension}}
void foo0(T);
template<typename T = int> // expected-warning{{default template arguments for a function template are a C++0x extension}}
template<typename T = int> // expected-warning{{default template arguments for a function template are a C++11 extension}}
void foo1(T) { }
// [...] nor in the template-parameter-list of the definition of a

View File

@ -30,7 +30,7 @@ void foo(id <NSObject>(^objectCreationBlock)(void)) {
// Test4
struct S {
S *(^a)() = ^{ // expected-warning {{C++0x}}
S *(^a)() = ^{ // expected-warning {{C++11}}
return this;
};
};
@ -40,7 +40,7 @@ S s;
struct X {
void f() {
^ {
struct Nested { Nested *ptr = this; }; // expected-warning {{C++0x}}
struct Nested { Nested *ptr = this; }; // expected-warning {{C++11}}
} ();
};
};

View File

@ -1,11 +1,11 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
struct A {
A(const A&) = delete; // expected-warning {{accepted as a C++0x extension}}
A& operator=(const A&) = delete; // expected-warning {{accepted as a C++0x extension}}
A() = default; // expected-warning {{accepted as a C++0x extension}}
A(const A&) = delete; // expected-warning {{accepted as a C++11 extension}}
A& operator=(const A&) = delete; // expected-warning {{accepted as a C++11 extension}}
A() = default; // expected-warning {{accepted as a C++11 extension}}
~A();
};
void f() = delete; // expected-warning {{accepted as a C++0x extension}}
A::~A() = default; //expected-warning {{accepted as a C++0x extension}}
void f() = delete; // expected-warning {{accepted as a C++11 extension}}
A::~A() = default; //expected-warning {{accepted as a C++11 extension}}

View File

@ -18,4 +18,4 @@ int & volatile Y = val; // expected-error {{'volatile' qualifier may not be appl
int & const volatile Z = val; /* expected-error {{'const' qualifier may not be applied}} \
expected-error {{'volatile' qualifier may not be applied}} */
typedef int && RV; // expected-warning {{rvalue references are a C++0x extension}}
typedef int && RV; // expected-warning {{rvalue references are a C++11 extension}}

View File

@ -1,10 +1,10 @@
// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
inline namespace N { // expected-warning{{inline namespaces are a C++0x feature}}
inline namespace N { // expected-warning{{inline namespaces are a C++11 feature}}
struct X {
template<typename ...Args> // expected-warning{{variadic templates are a C++0x extension}}
void f(Args &&...) &; // expected-warning{{rvalue references are a C++0x extension}} \
// expected-warning{{reference qualifiers on functions are a C++0x extension}}
template<typename ...Args> // expected-warning{{variadic templates are a C++11 extension}}
void f(Args &&...) &; // expected-warning{{rvalue references are a C++11 extension}} \
// expected-warning{{reference qualifiers on functions are a C++11 extension}}
};
}

View File

@ -2,6 +2,6 @@
void f() {
int arr[] = { 1, 2, 3 };
for (auto &i : arr) { // expected-warning {{'auto' type specifier is a C++0x extension}} expected-warning {{range-based for loop is a C++0x extension}}
for (auto &i : arr) { // expected-warning {{'auto' type specifier is a C++11 extension}} expected-warning {{range-based for loop is a C++11 extension}}
}
}

View File

@ -3,7 +3,7 @@ class Base {
virtual ~Base(); // expected-note {{implicitly declared private here}}
};
struct Foo : public Base { // expected-error {{base class 'Base' has private destructor}}
const int kBlah = 3; // expected-warning {{accepted as a C++0x extension}}
const int kBlah = 3; // expected-warning {{accepted as a C++11 extension}}
Foo();
};
struct Bar : public Foo {

View File

@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
void f() {
auto int a; // expected-warning {{'auto' storage class specifier is not permitted in C++0x, and will not be supported in future releases}}
auto int a; // expected-warning {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
int auto b; // expected-error{{cannot combine with previous 'int' declaration specifier}}
}

View File

@ -1,8 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
void f() {
auto int a; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}}
int auto b; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}}
auto c; // expected-warning {{C++0x extension}} expected-error {{requires an initializer}}
static auto d = 0; // expected-warning {{C++0x extension}}
auto static e = 0; // expected-warning {{C++0x extension}}
auto int a; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++11}}
int auto b; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++11}}
auto c; // expected-warning {{C++11 extension}} expected-error {{requires an initializer}}
static auto d = 0; // expected-warning {{C++11 extension}}
auto static e = 0; // expected-warning {{C++11 extension}}
}

View File

@ -34,12 +34,12 @@ public:
enum E1 { en1, en2 };
int i = 0; // expected-warning {{in-class initialization of non-static data member accepted as a C++0x extension}}
int i = 0; // expected-warning {{in-class initialization of non-static data member accepted as a C++11 extension}}
static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
static const int nci = vs; // expected-error {{in-class initializer is not a constant expression}}
static const int vi = 0;
static const volatile int cvi = 0; // ok, illegal in C++0x
static const volatile int cvi = 0; // ok, illegal in C++11
static const E evi = 0;
void m() {

View File

@ -8,7 +8,7 @@ struct ConvToInt {
};
struct ExplicitConvToBool {
explicit operator bool(); // expected-warning{{explicit conversion functions are a C++0x extension}}
explicit operator bool(); // expected-warning{{explicit conversion functions are a C++11 extension}}
};
void test_conv_to_bool(ConvToBool ctb, ConvToInt cti, ExplicitConvToBool ecb) {
@ -39,7 +39,7 @@ void test_conv_to_bool(ConvToBool ctb, ConvToInt cti, ExplicitConvToBool ecb) {
void accepts_bool(bool) { } // expected-note{{candidate function}}
struct ExplicitConvToRef {
explicit operator int&(); // expected-warning{{explicit conversion functions are a C++0x extension}}
explicit operator int&(); // expected-warning{{explicit conversion functions are a C++11 extension}}
};
void test_explicit_bool(ExplicitConvToBool ecb) {
@ -56,7 +56,7 @@ void test_explicit_conv_to_ref(ExplicitConvToRef ecr) {
struct A { };
struct B { };
struct C {
explicit operator A&(); // expected-warning{{explicit conversion functions are a C++0x extension}}
explicit operator A&(); // expected-warning{{explicit conversion functions are a C++11 extension}}
operator B&(); // expected-note{{candidate}}
};

View File

@ -13,12 +13,12 @@ namespace M {
}
void f() {
auto int n = 0; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}}
auto int n = 0; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++11}}
}
int n;
struct S {
char c;
}
s = { n }, // expected-warning {{non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list in C++0x}} expected-note {{explicit cast}}
t = { 1234 }; // expected-warning {{constant expression evaluates to 1234 which cannot be narrowed to type 'char' in C++0x}} expected-warning {{changes value}} expected-note {{explicit cast}}
s = { n }, // expected-warning {{non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list in C++11}} expected-note {{explicit cast}}
t = { 1234 }; // expected-warning {{constant expression evaluates to 1234 which cannot be narrowed to type 'char' in C++11}} expected-warning {{changes value}} expected-note {{explicit cast}}

View File

@ -1,17 +1,17 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// This test checks for a teeny tiny subset of the functionality in
// the C++0x generalized initializer lists feature, which happens to
// the C++11 generalized initializer lists feature, which happens to
// be used in libstdc++ 4.5. We accept only this syntax so that Clang
// can handle the libstdc++ 4.5 headers.
int test0(int i) {
return { i }; // expected-warning{{generalized initializer lists are a C++0x extension unsupported in Clang}}
return { i }; // expected-warning{{generalized initializer lists are a C++11 extension unsupported in Clang}}
}
template<typename T, typename U>
T test1(U u) {
return { u }; // expected-warning{{generalized initializer lists are a C++0x extension unsupported in Clang}}
return { u }; // expected-warning{{generalized initializer lists are a C++11 extension unsupported in Clang}}
}
template int test1(char);

View File

@ -19,8 +19,8 @@ struct IndirectValueInt : ValueInt { };
struct TwoValueInts : ValueInt, IndirectValueInt { };
void test() {
(void)new int[ValueInt(10)]; // expected-warning{{implicit conversion from array size expression of type 'ValueInt' to integral type 'int' is a C++0x extension}}
(void)new int[ValueEnum()]; // expected-warning{{implicit conversion from array size expression of type 'ValueEnum' to enumeration type 'E' is a C++0x extension}}
(void)new int[ValueInt(10)]; // expected-warning{{implicit conversion from array size expression of type 'ValueInt' to integral type 'int' is a C++11 extension}}
(void)new int[ValueEnum()]; // expected-warning{{implicit conversion from array size expression of type 'ValueEnum' to enumeration type 'E' is a C++11 extension}}
(void)new int[ValueBoth()]; // expected-error{{ambiguous conversion of array size expression of type 'ValueBoth' to an integral or enumeration type}}
(void)new int[TwoValueInts()]; // expected-error{{ambiguous conversion of array size expression of type 'TwoValueInts' to an integral or enumeration type}}

View File

@ -46,7 +46,7 @@ namespace PR9654 {
namespace AliasTagDef {
template<typename T>
T f() {
using S = struct { // expected-warning {{C++0x}}
using S = struct { // expected-warning {{C++11}}
T g() {
return T();
}

View File

@ -108,7 +108,7 @@ namespace test2 {
namespace AliasTagDef {
template<typename T>
struct F {
using S = struct U { // expected-warning {{C++0x}}
using S = struct U { // expected-warning {{C++11}}
T g() {
return T();
}

View File

@ -7,7 +7,7 @@ A<int()> *a1; // expected-error{{template argument for non-type template paramet
A<int> *a2; // expected-error{{template argument for non-type template parameter must be an expression}}
A<1 >> 2> *a3; // expected-warning{{use of right-shift operator ('>>') in template argument will require parentheses in C++0x}}
A<1 >> 2> *a3; // expected-warning{{use of right-shift operator ('>>') in template argument will require parentheses in C++11}}
// C++ [temp.arg.nontype]p5:
A<A> *a4; // expected-error{{must be an expression}}