diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-10-19 23:22:49 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-19 23:22:49 +0000 |
commit | fac5243493ffdf437d5f02bc20e14b1d3205fd8e (patch) | |
tree | 5fb45face7e952590fabae7540a6caf293d8767e /clang/lib/AST/ASTContext.cpp | |
parent | 1e59a66c695527b196a7a97f46451beb682f1119 (diff) | |
download | bcm5719-llvm-fac5243493ffdf437d5f02bc20e14b1d3205fd8e.tar.gz bcm5719-llvm-fac5243493ffdf437d5f02bc20e14b1d3205fd8e.zip |
[MS ABI] Give linkonce_odr, instead of external_linkage, to certain kinds of static data members
Out-of-line definitions of static data members which have an inline
initializer must get GVA_DiscardableODR linkage instead of
GVA_StrongExternal linkage.
MSVC 2013's behavior is different with respect to this and would cause
link errors if one TU provided a definition while another did not.
MSVC 2015 fixed this bug, making this OK. Note that the 2015 behavior
is always compatible with 2013: it never produces a strong definition.
This essentially reverts r237787.
llvm-svn: 250757
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index ffa8cbbf6c5..848158877aa 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5035,8 +5035,8 @@ CharUnits ASTContext::getObjCEncodingTypeSize(QualType type) const { bool ASTContext::isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const { return getTargetInfo().getCXXABI().isMicrosoft() && VD->isStaticDataMember() && - VD->getType()->isIntegralOrEnumerationType() && VD->isFirstDecl() && - !VD->isOutOfLine() && VD->hasInit(); + VD->getType()->isIntegralOrEnumerationType() && + !VD->getFirstDecl()->isOutOfLine() && VD->getFirstDecl()->hasInit(); } static inline |