[PATCH] D128649: [clang-cl] Accept a pragma alloc_text corner case accepted by MSVC

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 08:08:24 PDT 2022


hans added inline comments.


================
Comment at: clang/lib/Sema/SemaAttr.cpp:811
       return;
     }
 
----------------
Since the pragma only applies to functions, maybe we should error here if the decl is not a FunctionDecl?


================
Comment at: clang/lib/Sema/SemaAttr.cpp:816
+      Decl *D = ND;
+      while (D != nullptr) {
+        if (auto *FD = dyn_cast<FunctionDecl>(D)) {
----------------
Instead of walking the decls, would checking isExternC() on the getCanonicalDecl() be enough?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128649/new/

https://reviews.llvm.org/D128649



More information about the cfe-commits mailing list