[PATCH] Allow empty statements in naked functions in addition to ASM statements

Hans Wennborg hans at chromium.org
Mon Sep 8 19:41:13 PDT 2014


================
Comment at: lib/Sema/SemaDecl.cpp:10429
@@ -10428,3 +10428,3 @@
       for (const Stmt *S : Body->children()) {
-        if (!isa<AsmStmt>(S)) {
+        if (!isa<AsmStmt>(S) && S->child_begin() != S->child_end()) {
           Diag(S->getLocStart(), diag::err_non_asm_stmt_in_naked_function);
----------------
Hmm, it feels like there could be other statements which don't have any children but are not a NullStmt. Might be safer to just check for NullStmt explicitly.

http://reviews.llvm.org/D5256






More information about the cfe-commits mailing list