Skip to content

Commit 0a65574

Browse files
committed
implement support for -Wno-deprecated, PR6534. While
I'm in there, change the altivec diagnostics to use 'double' instead of "double" for consistency. llvm-svn: 97919
1 parent aba6ea8 commit 0a65574

File tree

6 files changed

+49
-46
lines changed

6 files changed

+49
-46
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def warn_drv_missing_resource_library : Warning<
9090
def warn_drv_conflicting_deployment_targets : Warning<
9191
"conflicting deployment targets, both MACOSX_DEPLOYMENT_TARGET '%0' and IPHONEOS_DEPLOYMENT_TARGET '%1' are present in environment">;
9292
def warn_drv_treating_input_as_cxx : Warning<
93-
"treating '%0' input as '%1' when in C++ mode, this behavior is deprecated">;
93+
"treating '%0' input as '%1' when in C++ mode, this behavior is deprecated">,
94+
InGroup<Deprecated>;
9495

9596
}

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def : DiagGroup<"char-align">;
3232
def Comment : DiagGroup<"comment">;
3333
def : DiagGroup<"ctor-dtor-privacy">;
3434
def : DiagGroup<"declaration-after-statement">;
35+
def Deprecated : DiagGroup<"deprecated">;
3536
def : DiagGroup<"disabled-optimization">;
3637
def : DiagGroup<"discard-qual">;
3738
def : DiagGroup<"div-by-zero">;

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ def err_typename_invalid_functionspec : Error<
159159
def err_invalid_decl_spec_combination : Error<
160160
"cannot combine with previous '%0' declaration specifier">;
161161
def err_invalid_vector_decl_spec_combination : Error<
162-
"cannot combine with previous '%0' declaration specifier. \"__vector\" must be first">;
162+
"cannot combine with previous '%0' declaration specifier. '__vector' must be first">;
163163
def err_invalid_pixel_decl_spec_combination : Error<
164-
"\"__pixel\" must be preceded by \"__vector\". '%0' declaration specifier not allowed here">;
164+
"'__pixel' must be preceded by '__vector'. '%0' declaration specifier not allowed here">;
165165
def err_invalid_vector_double_decl_spec_combination : Error<
166-
"cannot use \"double\" with \"__vector\"">;
166+
"cannot use 'double' with '__vector'">;
167167
def warn_vector_long_decl_spec_combination : Warning<
168-
"Use of \"long\" with \"__vector\" is deprecated">;
168+
"Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>;
169169
def err_friend_invalid_in_context : Error<
170170
"'friend' used outside of class">;
171171
def err_unknown_typename : Error<

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ def err_using_decl_conflict_reverse : Error<
141141
def note_using_decl : Note<"%select{|previous }0using declaration">;
142142

143143
def warn_access_decl_deprecated : Warning<
144-
"access declarations are deprecated; use using declarations instead">;
144+
"access declarations are deprecated; use using declarations instead">,
145+
InGroup<Deprecated>;
145146

146147
def err_invalid_thread : Error<
147148
"'__thread' is only allowed on variable declarations">;
@@ -1788,7 +1789,7 @@ def err_array_init_not_init_list : Error<
17881789
"array initializer must be an initializer "
17891790
"list%select{| or string literal}0">;
17901791
def warn_deprecated_string_literal_conversion : Warning<
1791-
"conversion from string literal to %0 is deprecated">;
1792+
"conversion from string literal to %0 is deprecated">, InGroup<Deprecated>;
17921793
def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">;
17931794
def err_typecheck_sclass_fscope : Error<
17941795
"illegal storage class on file-scoped variable">;
@@ -2046,7 +2047,7 @@ def note_delete_member_function_declared_here : Note<
20462047
"%0 declared here">;
20472048
def err_decrement_bool : Error<"cannot decrement expression of type bool">;
20482049
def warn_increment_bool : Warning<
2049-
"incrementing expression of type bool is deprecated">;
2050+
"incrementing expression of type bool is deprecated">, InGroup<Deprecated>;
20502051
def err_catch_incomplete_ptr : Error<
20512052
"cannot catch pointer to incomplete type %0">;
20522053
def err_catch_incomplete_ref : Error<

clang/test/Parser/altivec.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ void f_a(vector int a);
4141
void f_a2(int b, vector int a);
4242

4343
// These should have warnings.
44-
__vector long vv_l; // expected-warning {{Use of "long" with "__vector" is deprecated}}
45-
__vector signed long vv_sl; // expected-warning {{Use of "long" with "__vector" is deprecated}}
46-
__vector unsigned long vv_ul; // expected-warning {{Use of "long" with "__vector" is deprecated}}
47-
__vector long int vv_li; // expected-warning {{Use of "long" with "__vector" is deprecated}}
48-
__vector signed long int vv_sli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
49-
__vector unsigned long int vv_uli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
50-
vector long v_l; // expected-warning {{Use of "long" with "__vector" is deprecated}}
51-
vector signed long v_sl; // expected-warning {{Use of "long" with "__vector" is deprecated}}
52-
vector unsigned long v_ul; // expected-warning {{Use of "long" with "__vector" is deprecated}}
53-
vector long int v_li; // expected-warning {{Use of "long" with "__vector" is deprecated}}
54-
vector signed long int v_sli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
55-
vector unsigned long int v_uli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
56-
__vector long double vv_ld; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
57-
vector long double v_ld; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
44+
__vector long vv_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
45+
__vector signed long vv_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
46+
__vector unsigned long vv_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
47+
__vector long int vv_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
48+
__vector signed long int vv_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
49+
__vector unsigned long int vv_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
50+
vector long v_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
51+
vector signed long v_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
52+
vector unsigned long v_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
53+
vector long int v_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
54+
vector signed long int v_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
55+
vector unsigned long int v_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
56+
__vector long double vv_ld; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
57+
vector long double v_ld; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
5858

5959
// These should have errors.
60-
__vector double vv_d; // expected-error {{cannot use "double" with "__vector"}}
61-
__vector double vv_d; // expected-error {{cannot use "double" with "__vector"}}
62-
vector double v_d; // expected-error {{cannot use "double" with "__vector"}}
63-
vector double v_d; // expected-error {{cannot use "double" with "__vector"}}
64-
__vector long double vv_ld; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
65-
vector long double v_ld; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
60+
__vector double vv_d; // expected-error {{cannot use 'double' with '__vector'}}
61+
__vector double vv_d; // expected-error {{cannot use 'double' with '__vector'}}
62+
vector double v_d; // expected-error {{cannot use 'double' with '__vector'}}
63+
vector double v_d; // expected-error {{cannot use 'double' with '__vector'}}
64+
__vector long double vv_ld; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
65+
vector long double v_ld; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
6666

6767
void f() {
6868
__vector unsigned int v = {0,0,0,0};

clang/test/Parser/cxx-altivec.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,26 @@ void f_a(vector int a);
4343
void f_a2(int b, vector int a);
4444

4545
// These should have warnings.
46-
__vector long vv_l; // expected-warning {{Use of "long" with "__vector" is deprecated}}
47-
__vector signed long vv_sl; // expected-warning {{Use of "long" with "__vector" is deprecated}}
48-
__vector unsigned long vv_ul; // expected-warning {{Use of "long" with "__vector" is deprecated}}
49-
__vector long int vv_li; // expected-warning {{Use of "long" with "__vector" is deprecated}}
50-
__vector signed long int vv_sli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
51-
__vector unsigned long int vv_uli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
52-
vector long v_l; // expected-warning {{Use of "long" with "__vector" is deprecated}}
53-
vector signed long v_sl; // expected-warning {{Use of "long" with "__vector" is deprecated}}
54-
vector unsigned long v_ul; // expected-warning {{Use of "long" with "__vector" is deprecated}}
55-
vector long int v_li; // expected-warning {{Use of "long" with "__vector" is deprecated}}
56-
vector signed long int v_sli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
57-
vector unsigned long int v_uli; // expected-warning {{Use of "long" with "__vector" is deprecated}}
58-
__vector long double vv_ld; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
59-
vector long double v_ld; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
46+
__vector long vv_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
47+
__vector signed long vv_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
48+
__vector unsigned long vv_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
49+
__vector long int vv_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
50+
__vector signed long int vv_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
51+
__vector unsigned long int vv_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
52+
vector long v_l; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
53+
vector signed long v_sl; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
54+
vector unsigned long v_ul; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
55+
vector long int v_li; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
56+
vector signed long int v_sli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
57+
vector unsigned long int v_uli; // expected-warning {{Use of 'long' with '__vector' is deprecated}}
58+
__vector long double vv_ld; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
59+
vector long double v_ld; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
6060

6161
// These should have errors.
62-
__vector double vv_d1; // expected-error {{cannot use "double" with "__vector"}}
63-
vector double v_d2; // expected-error {{cannot use "double" with "__vector"}}
64-
__vector long double vv_ld3; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
65-
vector long double v_ld4; // expected-warning {{Use of "long" with "__vector" is deprecated}} expected-error {{cannot use "double" with "__vector"}}
62+
__vector double vv_d1; // expected-error {{cannot use 'double' with '__vector'}}
63+
vector double v_d2; // expected-error {{cannot use 'double' with '__vector'}}
64+
__vector long double vv_ld3; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
65+
vector long double v_ld4; // expected-warning {{Use of 'long' with '__vector' is deprecated}} expected-error {{cannot use 'double' with '__vector'}}
6666

6767
void f() {
6868
__vector unsigned int v = {0,0,0,0};

0 commit comments

Comments
 (0)