diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-11-02 01:40:23 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-11-02 01:40:23 +0000 |
commit | 80a8eb76a0043271adcfee5cb1e643ce3927fcbf (patch) | |
tree | 95a0580a21c74ede930e4e51e3096a9dd54ca0a5 | |
parent | cef3a7bf84817c58c7666df9e87199b9a6b8b9a3 (diff) |
Tweak wording and add diagnostic groups to misc diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167274 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 7 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.td | 5 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 8 | ||||
-rw-r--r-- | test/Misc/warning-flags.c | 2 | ||||
-rw-r--r-- | test/Sema/builtins.c | 2 | ||||
-rw-r--r-- | test/Sema/cast-to-union.c | 6 | ||||
-rw-r--r-- | test/Sema/exprs.c | 2 |
7 files changed, 18 insertions, 14 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 1652236a61..77db0a3290 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -127,15 +127,16 @@ def warn_char_constant_too_large : Warning< def err_multichar_utf_character_literal : Error< "Unicode character literals may not contain multiple characters">; def err_exponent_has_no_digits : Error<"exponent has no digits">; -def ext_imaginary_constant : Extension<"imaginary constants are an extension">; +def ext_imaginary_constant : Extension< + "imaginary constants are a GNU extension">, InGroup<GNU>; def err_hexconstant_requires_exponent : Error< "hexadecimal floating constants require an exponent">; def err_hexconstant_requires_digits : Error< "hexadecimal floating constants require a significand">; def ext_hexconstant_invalid : Extension< - "hexadecimal floating constants are a C99 feature">; + "hexadecimal floating constants are a C99 feature">, InGroup<C99>; def ext_binary_literal : Extension< - "binary integer literals are an extension">; + "binary integer literals are a GNU extension">, InGroup<GNU>; def err_pascal_string_too_long : Error<"Pascal string is too long">; def warn_octal_escape_too_large : ExtWarn<"octal escape sequence out of range">; def warn_hex_escape_too_large : ExtWarn<"hex escape sequence out of range">; diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 929835a2ca..99932bc4e7 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -50,7 +50,7 @@ def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">, def ext_plain_complex : ExtWarn< "plain '_Complex' requires a type specifier; assuming '_Complex double'">; def ext_integer_complex : Extension< - "complex integer types are an extension">; + "complex integer types are a GNU extension">, InGroup<GNU>; def ext_thread_before : Extension<"'__thread' before '%0'">; def ext_empty_struct_union : Extension< @@ -445,7 +445,8 @@ def err_expected_member_or_base_name : Error< def err_expected_lbrace_after_base_specifiers : Error< "expected '{' after base class list">; def ext_ellipsis_exception_spec : Extension< - "exception specification of '...' is a Microsoft extension">; + "exception specification of '...' is a Microsoft extension">, + InGroup<Microsoft>; def err_dynamic_and_noexcept_specification : Error< "cannot have both throw() and noexcept() clause on the same function">; def warn_cxx98_compat_noexcept_decl : Warning< diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 97e49bb49f..ab5023f566 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -95,7 +95,7 @@ def err_variably_modified_new_type : Error< // C99 Designated Initializers def ext_designated_init : Extension< - "designated initializers are a C99 feature">; + "designated initializers are a C99 feature">, InGroup<C99>; def err_array_designator_negative : Error< "array designator value '%0' is negative">; def err_array_designator_empty_range : Error< @@ -5047,7 +5047,9 @@ def err_typecheck_cast_to_incomplete : Error< "cast to incomplete type %0">; def ext_typecheck_cast_nonscalar : Extension< "C99 forbids casting nonscalar type %0 to the same type">; -def ext_typecheck_cast_to_union : Extension<"C99 forbids casts to union type">; +def ext_typecheck_cast_to_union : Extension< + "cast to union type is a GNU extension">, + InGroup<GNU>; def err_typecheck_cast_to_union_no_type : Error< "cast to union type from type %0 not present in union">; def err_cast_pointer_from_non_pointer_int : Error< @@ -5214,7 +5216,7 @@ def err_in_class_initializer_references_def_ctor : Error< def ext_in_class_initializer_non_constant : Extension< "in-class initializer for static data member is not a constant expression; " - "folding it to a constant is a GNU extension">; + "folding it to a constant is a GNU extension">, InGroup<GNU>; // C++ anonymous unions and GNU anonymous structs/unions def ext_anonymous_union : Extension< diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index c29f495bac..721bc3d788 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -173,4 +173,4 @@ CHECK-NEXT: warn_weak_import The list of warnings in -Wpedantic should NEVER grow. -CHECK: Number in -Wpedantic (not covered by other -W flags): 37 +CHECK: Number in -Wpedantic (not covered by other -W flags): 29 diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c index 357b7b6aa0..e3b3b7e831 100644 --- a/test/Sema/builtins.c +++ b/test/Sema/builtins.c @@ -40,7 +40,7 @@ void test9(short v) { old = __sync_fetch_and_add(); // expected-error {{too few arguments to function call}} old = __sync_fetch_and_add(&old); // expected-error {{too few arguments to function call}} - old = __sync_fetch_and_add((unsigned*)0, 42i); // expected-warning {{imaginary constants are an extension}} + old = __sync_fetch_and_add((unsigned*)0, 42i); // expected-warning {{imaginary constants are a GNU extension}} // PR7600: Pointers are implicitly casted to integers and back. void *old_ptr = __sync_val_compare_and_swap((void**)0, 0, 0); diff --git a/test/Sema/cast-to-union.c b/test/Sema/cast-to-union.c index c32964dfc0..7b995e3d0c 100644 --- a/test/Sema/cast-to-union.c +++ b/test/Sema/cast-to-union.c @@ -4,16 +4,16 @@ union u { int i; unsigned : 3; }; void f(union u); void test(int x) { - f((union u)x); // expected-warning {{C99 forbids casts to union type}} + f((union u)x); // expected-warning {{cast to union type is a GNU extension}} f((union u)&x); // expected-error {{cast to union type from type 'int *' not present in union}} f((union u)2U); // expected-error {{cast to union type from type 'unsigned int' not present in union}} } -union u w = (union u)2; // expected-warning {{C99 forbids casts to union type}} +union u w = (union u)2; // expected-warning {{cast to union type is a GNU extension}} union u ww = (union u)1.0; // expected-error{{cast to union type from type 'double' not present in union}} union u x = 7; // expected-error{{initializing 'union u' with an expression of incompatible type 'int'}} int i; -union u zz = (union u)i; // expected-error{{initializer element is not a compile-time constant}} expected-warning {{C99 forbids casts to union type}} +union u zz = (union u)i; // expected-error{{initializer element is not a compile-time constant}} expected-warning {{cast to union type is a GNU extension}} struct s {int a, b;}; struct s y = { 1, 5 }; diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c index a93e12ec39..df3e25857c 100644 --- a/test/Sema/exprs.c +++ b/test/Sema/exprs.c @@ -40,7 +40,7 @@ _Complex double test1() { } _Complex double test2() { - return 1.0if; // expected-warning {{imaginary constants are an extension}} + return 1.0if; // expected-warning {{imaginary constants are a GNU extension}} } // rdar://6097308 |