[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-declaration %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wextra %s + AaronBallman wrote: It would be good to add a RUN line along these lines: ```suggestion // RUN: %clang_cc1 -fsyntax-only -

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -3348,6 +3348,7 @@ void Parser::ParseDeclarationSpecifiers( while (true) { bool isInvalid = false; bool isStorageClass = false; +bool isFunctionSpecifier = false; AaronBallman wrote: Hmmm, what's obsoleted are storage class specifiers that are

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -88,6 +88,8 @@ def err_param_redefinition : Error<"redefinition of parameter %0">; def warn_method_param_redefinition : Warning<"redefinition of method parameter %0">; def warn_method_param_declaration : Warning<"redeclaration of method parameter %0">, InGroup, DefaultI

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-declaration %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wextra %s + +static int x0; +int __attribute__ ((aligned (16))) static x1; // expected-warning {{'static' is not at beginning of declaration}} + +exter

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -4104,6 +4106,7 @@ void Parser::ParseDeclarationSpecifiers( isInvalid = true; } else { isInvalid = DS.setFunctionSpecVirtual(Loc, PrevSpec, DiagID); +isFunctionSpecifier = true; AaronBallman wrote: C doesn't have virtual functi

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -4140,12 +4143,14 @@ void Parser::ParseDeclarationSpecifiers( } isInvalid = DS.setFunctionSpecExplicit(ExplicitLoc, PrevSpec, DiagID, ExplicitSpec, CloseParenLoc); + isFunctionSpecifier = true; Aa

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-declaration %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wextra %s + +static int x0; +int __attribute__ ((aligned (16))) static x1; // expected-warning {{'static' is not at beginning of declaration}} + +exter

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for working on this! Please be sure to add release notes to clang/docs/ReleaseNotes.rst so users know about the new diagnostic capabilities. https://github.com/llvm/llvm-project/pull/78837 ___ cfe-c

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-20 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/78837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-02-19 Thread via cfe-commits
SihangZhu wrote: > ping repeat:) https://github.com/llvm/llvm-project/pull/78837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] support Wold-style-declaration (PR #78837)

2024-01-20 Thread via cfe-commits
https://github.com/SihangZhu edited https://github.com/llvm/llvm-project/pull/78837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits