-
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.
[Clang] Update missing varargs arg extension warnings (#84520)
This updates a few warnings that were diagnosing no arguments for a `...` variadic macro parameter as a GNU extension when it actually is a C++20/C23 extension now. This fixes #84495.
- Loading branch information
Showing
7 changed files
with
42 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// RUN: %clang_cc1 -Eonly -std=c++17 -pedantic -verify %s | ||
// RUN: %clang_cc1 -Eonly -std=c17 -pedantic -verify -x c %s | ||
// RUN: %clang_cc1 -Eonly -std=c++20 -pedantic -Wpre-c++20-compat -verify=compat %s | ||
// RUN: %clang_cc1 -Eonly -std=c17 -pedantic -verify=c17,expected -x c %s | ||
// RUN: %clang_cc1 -Eonly -std=c23 -pedantic -Wpre-c23-compat -verify=c23,expected -x c %s | ||
// RUN: %clang_cc1 -Eonly -std=c++17 -pedantic -verify=cxx17,expected %s | ||
// RUN: %clang_cc1 -Eonly -std=c++20 -pedantic -Wpre-c++20-compat -verify=cxx20,expected %s | ||
|
||
#define FOO(x, ...) // expected-note {{macro 'FOO' defined here}} \ | ||
// compat-note {{macro 'FOO' defined here}} | ||
// silent-no-diagnostics | ||
|
||
#define FOO(x, ...) // expected-note {{macro 'FOO' defined here}} | ||
|
||
int main() { | ||
FOO(42) // expected-warning {{must specify at least one argument for '...' parameter of variadic macro}} \ | ||
// compat-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20}} | ||
FOO(42) // c17-warning {{passing no argument for the '...' parameter of a variadic macro is a C23 extension}} \ | ||
// cxx17-warning {{passing no argument for the '...' parameter of a variadic macro is a C++20 extension}} \ | ||
// c23-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C standards before C23}} \ | ||
// cxx20-warning {{passing no argument for the '...' parameter of a variadic macro is incompatible with C++ standards before C++20}} | ||
} | ||
|
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