diff options
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 96d0659d3e7..091b2fe3462 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -9915,25 +9915,10 @@ static GVALinkage basicGVALinkageForVariable(const ASTContext &Context, return StrongLinkage; case TSK_ExplicitSpecialization: - if (Context.getTargetInfo().getCXXABI().isMicrosoft()) { - // If this is a fully specialized constexpr variable template, pretend it - // was marked inline. MSVC 14.21.27702 headers define _Is_integral in a - // header this way, and we don't want to emit non-discardable definitions - // of these variables in every TU that includes <type_traits>. This - // behavior is non-conforming, since another TU could use an extern - // template declaration for this variable, but for constexpr variables, - // it's unlikely for a user to want to do that. This behavior can be - // removed if the headers change to explicitly mark such variable template - // specializations inline. - if (isa<VarTemplateSpecializationDecl>(VD) && VD->isConstexpr()) - return GVA_DiscardableODR; - - // Use ODR linkage for static data members of fully specialized templates - // to prevent duplicate definition errors with MSVC. - if (VD->isStaticDataMember()) - return GVA_StrongODR; - } - return StrongLinkage; + return Context.getTargetInfo().getCXXABI().isMicrosoft() && + VD->isStaticDataMember() + ? GVA_StrongODR + : StrongLinkage; case TSK_ExplicitInstantiationDefinition: return GVA_StrongODR; |