[PATCH] D125011: [MSVC] Add support for pragma alloc_text

Stephen Long via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 06:48:20 PDT 2022


steplong added inline comments.


================
Comment at: clang/test/Sema/pragma-ms-alloc-text.cpp:5
+#pragma alloc_text(a        // expected-warning {{expected ',' in '#pragma alloc_text'}}
+#pragma alloc_text(a, a     // expected-warning {{missing ')' after '#pragma alloc_text'}} expected-error {{use of undeclared a}}
+#pragma alloc_text(L"a", a) // expected-warning {{expected a string literal for the section name}}
----------------
aaron.ballman wrote:
> This shows we have the parsing logic wrong -- we shouldn't get the use of undeclared identifier a because we shouldn't have gotten into Sema for this one.
MSVC accepts it and only warns about the missing paren if the identifier is declared like on Line 14. That's why I decided to handle it that way. We can decide to reject it though


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125011



More information about the cfe-commits mailing list