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

David Majnemer david.majnemer at gmail.com
Mon Jun 23 13:38:08 PDT 2014

Sure, I'll add a SemaCXX test for that.

Comment at: lib/AST/ExprConstant.cpp:4395
@@ -4393,1 +4394,3 @@
+    if (VD->hasAttr<DLLImportAttr>())
+      return ZeroInitialization(E);
     return Success(VD);
Reid Kleckner wrote:
> How is ZeroInitialization(E) different from Error(E)?
It isn't other than being, in my opinion, less confusing.  This isn't actually an error per-se because it isn't outright nonsense, it's just not evaluatable.  This matches what the codebase does for:
  int x = foo();

where `x` is at file scope and `foo` isn't constexpr.


More information about the cfe-commits mailing list