[PATCH] D16951: [MS ABI] dllimport'd class cannot have constexpr ctors

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 7 10:37:26 PST 2016


thakis added a comment.

Thanks for jumping on this so quickly! Hans can probably just stamp this, but I lack the background, so I must ask:


================
Comment at: test/SemaCXX/dllimport.cpp:1262
@@ -1261,1 +1261,3 @@
 
+struct __declspec(dllimport) PR26506_test1 {
+  virtual ~PR26506_test1() {}
----------------
cl.exe seems to accept this – do you know how they do that? Do they just silently ignore the constexpr?

================
Comment at: test/SemaCXX/dllimport.cpp:1269
@@ +1268,3 @@
+  virtual ~PR26506_test2() {}
+  constexpr PR26506_test2() {} // expected-error{{constructor cannot be marked constexpr}}
+};
----------------
nit: I feel diagnostics are easier to understand if their text is stand-alone and not spread across diag and its note. That is "dllimported constructors cannot be marked constexpr" "note: dllimported here" or something like this (this also helps with the mythical localization of diagnostics).


http://reviews.llvm.org/D16951





More information about the cfe-commits mailing list