]> granicus.if.org Git - clang/commit
AST: Address of dllimport functions isn't constant
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 24 Jun 2014 06:40:51 +0000 (06:40 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 24 Jun 2014 06:40:51 +0000 (06:40 +0000)
commit3e93571576d89e49dd1dc830d40243eb3a350790
tree87b0e4550b2568efc68f9e16f9eb1294c0bc7333
parent99ea974909aecf110b60b2d273f7cec97ebc0f11
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
lib/AST/ExprConstant.cpp
test/CodeGenCXX/PR19955.cpp
test/SemaCXX/PR19955.cpp