[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 14 08:19:48 PDT 2024


================
@@ -1110,6 +1110,8 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd) {
   }
 
   T.consumeClose();
+  if (T.getCloseLocation().isInvalid())
+    return nullptr;
----------------
cor3ntin wrote:

`consumeClose` returms true on failure so this can just be `if(T.consumeClose()) return nullptr`

https://github.com/llvm/llvm-project/pull/108701


More information about the cfe-commits mailing list