[PATCH] D20103: PR27132: Proper mangling for __unaligned qualifier (now with both PR27367 and PR27666 fixed)

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 08:43:08 PDT 2016


majnemer added a comment.

Can we test pointers to data members? Is it possible to have `__unaligned int *S::*` or `int *S::* __unaligned` or even `__unaligned int *S::* __unaligned` ?


================
Comment at: include/clang/AST/Type.h:446
@@ -437,1 +445,3 @@
+           // U qualifier may superset.
+           (!(other.Mask & UMask) || (Mask & UMask));
   }
----------------
Could this be `!other.hasUnaligned() || hasUnaligned()` ?

================
Comment at: include/clang/AST/Type.h:5393
@@ -5379,2 +5392,3 @@
 inline bool QualType::isAtLeastAsQualifiedAs(QualType other) const {
-  return getQualifiers().compatiblyIncludes(other.getQualifiers());
+  Qualifiers otherQuals = other.getQualifiers();
+
----------------
Variables should be capitalized.

================
Comment at: lib/Sema/SemaType.cpp:2681
@@ -2675,3 +2680,3 @@
   // Build a string naming the redundant qualifiers.
-  for (unsigned I = 0; I != 4; ++I) {
+  for (unsigned I = 0; I != 5; ++I) {
     if (Quals & QualKinds[I].Mask) {
----------------
If this was a ranged-for over `Fixits`, we wouldn't need to keep updating the loop bounds.


http://reviews.llvm.org/D20103





More information about the cfe-commits mailing list