[PATCH] D18596: [MSVC] PR27132: Proper mangling for __unaligned qualifier

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 07:26:51 PDT 2016


aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a comment.

I'd like to see some Sema tests for sanity checking; like applying __unaligned to a non-pointer type, to a declaration, when -fno-ms-extensions is enabled, etc.


================
Comment at: include/clang/Basic/Attr.td:2080
@@ -2079,2 +2079,3 @@
   let Spellings = [Keyword<"__unaligned">];
+  let Documentation = [UnalignedDocs];
 }
----------------
This is possibly missing `let LangOpts = [MicrosoftExt];`

================
Comment at: include/clang/Basic/AttrDocs.td:1964
@@ +1963,3 @@
+  let Content = [{
+The ``__unaligned`` modifier declares a pointer with unaligned address.
+It is available under the ``-fms-extensions`` flag for MSVC compatibility.
----------------
"an" unaligned address.

================
Comment at: lib/Sema/SemaType.cpp:5555
@@ -5552,1 +5554,3 @@
+  // anything, so this is an exception.
+  if (!isa<PointerType>(Desugared) && (Kind != AttributeList::AT_Unaligned)) {
     if (Type->isMemberPointerType())
----------------
This appears to be untested, but really should have a test case to ensure we don't regress later.


http://reviews.llvm.org/D18596





More information about the cfe-commits mailing list