-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add -Wdeprecated warnings and fixits for things deprecated in C++11:
- 'register' storage class - dynamic exception specifications Only the former check is enabled by default for now (the latter might be quite noisy). llvm-svn: 183881
- Loading branch information
Showing
10 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// RUN: %clang_cc1 -std=c++98 %s -Wdeprecated -verify | ||
// RUN: %clang_cc1 -std=c++11 %s -Wdeprecated -verify | ||
// RUN: %clang_cc1 -std=c++1y %s -Wdeprecated -verify | ||
|
||
void f() throw(); | ||
void g() throw(int); | ||
void h() throw(...); | ||
#if __cplusplus >= 201103L | ||
// expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept' instead}} | ||
// expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept(false)' instead}} | ||
// expected-warning@-4 {{dynamic exception specifications are deprecated}} expected-note@-4 {{use 'noexcept(false)' instead}} | ||
#endif | ||
|
||
void stuff() { | ||
register int n; | ||
#if __cplusplus >= 201103L | ||
// expected-warning@-2 {{'register' storage class specifier is deprecated}} | ||
#endif | ||
|
||
bool b; | ||
++b; // expected-warning {{incrementing expression of type bool is deprecated}} | ||
|
||
// FIXME: This is ill-formed in C++11. | ||
char *p = "foo"; // expected-warning {{conversion from string literal to 'char *' is deprecated}} | ||
} | ||
|
||
struct S { int n; }; | ||
struct T : private S { | ||
// FIXME: This is ill-formed in C++11. | ||
S::n; // expected-warning {{access declarations are deprecated; use using declarations instead}} | ||
}; |