[PATCH] AST: Address of dllimport variables isn't constant

Reid Kleckner rnk at google.com
Mon Jun 23 12:44:37 PDT 2014


Can you add a sema test for 'extern int __declspec(dllimport) y; constexpr int *x = &y;'?

================
Comment at: lib/AST/ExprConstant.cpp:4395
@@ -4393,1 +4394,3 @@
+    if (VD->hasAttr<DLLImportAttr>())
+      return ZeroInitialization(E);
     return Success(VD);
----------------
How is ZeroInitialization(E) different from Error(E)?

http://reviews.llvm.org/D4250






More information about the cfe-commits mailing list