Author: Oleksandr Tarasiuk Date: 2026-09-14T12:10:36+03:00 New Revision: 61519bf9fa07fed0546c2985a6884b60ca71ca2b
URL: https://github.com/llvm/llvm-project/commit/61519bf9fa07fed0546c2985a6884b60ca71ca2b DIFF: https://github.com/llvm/llvm-project/commit/61519bf9fa07fed0546c2985a6884b60ca71ca2b.diff LOG: [Clang][NFC] add test coverage for parameter declaration errors (#222562) Fixes #113465 Added: Modified: clang/test/SemaCXX/enum.cpp Removed: ################################################################################ diff --git a/clang/test/SemaCXX/enum.cpp b/clang/test/SemaCXX/enum.cpp index 44042d8bf5cfc..e13e45db0a937 100644 --- a/clang/test/SemaCXX/enum.cpp +++ b/clang/test/SemaCXX/enum.cpp @@ -151,3 +151,22 @@ class C { // expected-error {{unexpected ';' before ')'}} }; } + +namespace GH113465 { +struct A { }; + +enum E : int { A = 1, }; // expected-note {{struct 'A' is hidden by a non-type declaration of 'A' here}} +#if __cplusplus < 201103L +// expected-warning@-2 {{enumeration types with a fixed underlying type are a C++11 extension}} +// expected-warning@-3 {{commas at the end of enumerator lists are a C++11 extension}} +#endif + +struct B { // expected-note {{B defined here}} + void f(A // expected-error {{must use 'struct' tag to refer to type 'A' in this scope}} \ + // expected-error {{expected ';' after struct}} \ + // expected-note {{to match this '('}} +#pragma message "Any Message"*); // expected-error {{pragma message requires parenthesized string}} +}; // expected-error {{expected ')'}} + +void B::f(A *p) { } // expected-error {{out-of-line definition of 'f' does not match any declaration in 'GH113465::B'}} +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
