[clang] 6e505db - [clang][test] Add regression test for invalid 'int decltype {}' (#224855)

via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 04:06:13 PDT 2026


Author: Demo_mod
Date: 2026-09-20T19:06:07+08:00
New Revision: 6e505dbe194cd2cfb43e6de90e1e109d448800c9

URL: https://github.com/llvm/llvm-project/commit/6e505dbe194cd2cfb43e6de90e1e109d448800c9
DIFF: https://github.com/llvm/llvm-project/commit/6e505dbe194cd2cfb43e6de90e1e109d448800c9.diff

LOG: [clang][test] Add regression test for invalid 'int decltype {}' (#224855)

The parser crash on `int decltype {}` was fixed by #211221, but the test
it added only covers the `= 0` forms. Add the brace-init form reported
in the issue.

Fixes #165246

Added: 
    

Modified: 
    clang/test/Parser/decltype-crash.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/Parser/decltype-crash.cpp b/clang/test/Parser/decltype-crash.cpp
index af4622df5e54a..8471309665f1d 100644
--- a/clang/test/Parser/decltype-crash.cpp
+++ b/clang/test/Parser/decltype-crash.cpp
@@ -13,3 +13,8 @@ int decltype = 0;
 int *decltype = 0;
 // expected-error at -1 {{expected '(' after 'decltype'}}
 // expected-error at -2 {{expected unqualified-id}}
+
+// GH165246
+int decltype {};
+// expected-error at -1 {{expected '(' after 'decltype'}}
+// expected-error at -2 {{expected unqualified-id}}


        


More information about the cfe-commits mailing list