summaryrefslogtreecommitdiff
path: root/test/SemaCXX/PR19955.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-06-24 06:40:51 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-06-24 06:40:51 +0000
commit3e93571576d89e49dd1dc830d40243eb3a350790 (patch)
tree87b0e4550b2568efc68f9e16f9eb1294c0bc7333 /test/SemaCXX/PR19955.cpp
parent99ea974909aecf110b60b2d273f7cec97ebc0f11 (diff)
downloadclang-3e93571576d89e49dd1dc830d40243eb3a350790.tar.gz
AST: Address of dllimport functions isn't constant
The address of dllimport functions can be accessed one of two ways: - Through the IAT which is symbolically referred to with a symbol starting with __imp_. - Via the wrapper-function which ends up calling through the __imp_ symbol. The problem with using the wrapper-function is that it's address will not compare as equal in all translation units. Specifically, it will compare unequally with the translation unit which defines the function. This fixes PR19955. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/PR19955.cpp')
-rw-r--r--test/SemaCXX/PR19955.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/SemaCXX/PR19955.cpp b/test/SemaCXX/PR19955.cpp
index 81fa70d7f5..e0d4618f2c 100644
--- a/test/SemaCXX/PR19955.cpp
+++ b/test/SemaCXX/PR19955.cpp
@@ -1,4 +1,7 @@
// RUN: %clang_cc1 -triple i686-win32 -verify -std=c++11 %s
-extern int __attribute__((dllimport)) y;
-constexpr int *x = &y; // expected-error {{must be initialized by a constant expression}}
+extern int __attribute__((dllimport)) var;
+constexpr int *varp = &var; // expected-error {{must be initialized by a constant expression}}
+
+extern __attribute__((dllimport)) void fun();
+constexpr void (*funp)(void) = &fun; // expected-error {{must be initialized by a constant expression}}