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

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 8 10:21:33 PDT 2016


rnk added inline comments.

================
Comment at: test/SemaCXX/MicrosoftExtensions.cpp:89
@@ -84,1 +88,3 @@
+void foo_unaligned(int arg) {}
+void foo_unaligned(__unaligned int *arg) {}
 
----------------
Surely we can come up with some tougher overloading test cases. I noticed MSVC generates a warning when converting from '__unaligned T*' to 'T*' with this code:
```
extern "C" int puts(const char *);
void f(__unaligned int *p) {
  puts("unaligned");
}
void f(int *p) {
  puts("aligned");
}
void g(int *p) {
  puts("g");
}
int main() {
  int *p = 0;
  __unaligned int *q = 0;
  f(p);
  f(q);
  g(p);
  g(q); // C4090
}
```


http://reviews.llvm.org/D18596





More information about the cfe-commits mailing list