================
@@ -77,8 +77,10 @@ StmtResult Sema::ActOnDeclStmt(DeclGroupPtrTy dg, 
SourceLocation StartLoc,
                                SourceLocation EndLoc) {
   DeclGroupRef DG = dg.get();
 
-  // If we have an invalid decl, just return an error.
-  if (DG.isNull()) return StmtError();
+  // No declarations, so no statement. This is not an error: `int;` only warns,
+  // and a group emptied by an error was already diagnosed.
+  if (DG.isNull())
+    return StmtEmpty();
----------------
akash-manna-sky wrote:

I agreed!. The parser builds the null statement itself when the declaration 
produced nothing, and `ActOnDeclStmt` is unchanged.


https://github.com/llvm/llvm-project/pull/224682
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to