From: Eli Friedman Date: Fri, 2 Nov 2012 01:40:23 +0000 (+0000) Subject: Tweak wording and add diagnostic groups to misc diagnostics. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f88f06dd2d675171ad40bfccb0f4a9796a5f2fb;p=platform%2Fupstream%2Fllvm.git Tweak wording and add diagnostic groups to misc diagnostics. llvm-svn: 167274 --- diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index 1652236..77db0a3 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/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; 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; def ext_binary_literal : Extension< - "binary integer literals are an extension">; + "binary integer literals are a GNU extension">, InGroup; 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/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index 929835a..99932bc 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/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; 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; 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/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 97e49bb..ab5023f 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/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; 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; 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; // C++ anonymous unions and GNU anonymous structs/unions def ext_anonymous_union : Extension< diff --git a/clang/test/Misc/warning-flags.c b/clang/test/Misc/warning-flags.c index c29f495..721bc3d 100644 --- a/clang/test/Misc/warning-flags.c +++ b/clang/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/clang/test/Sema/builtins.c b/clang/test/Sema/builtins.c index 357b7b6..e3b3b7e 100644 --- a/clang/test/Sema/builtins.c +++ b/clang/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/clang/test/Sema/cast-to-union.c b/clang/test/Sema/cast-to-union.c index c32964d..7b995e3 100644 --- a/clang/test/Sema/cast-to-union.c +++ b/clang/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/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c index a93e12e..df3e258 100644 --- a/clang/test/Sema/exprs.c +++ b/clang/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