diff options
author | Reid Kleckner <rnk@google.com> | 2018-02-16 19:44:47 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-02-16 19:44:47 +0000 |
commit | d23e73cda92fd4a4831568092c94b3ab24abe433 (patch) | |
tree | 2e057e7891d2fb53620f9035437f0d656a491615 /clang/lib/AST/ASTContext.cpp | |
parent | a84485ed8d0f41e127a2e906ccd2c6dc99f512e1 (diff) | |
download | bcm5719-llvm-d23e73cda92fd4a4831568092c94b3ab24abe433.tar.gz bcm5719-llvm-d23e73cda92fd4a4831568092c94b3ab24abe433.zip |
[MS] Make constexpr static data members implicitly inline
This handles them exactly the same way that we handle const integral
static data members with inline definitions, which is what MSVC does.
As a follow-up, now that we have a way to mark variables inline in the
AST, we should consider marking them implicitly inline there instead of
only treating them as inline in CodeGen. Unfortunately, this breaks a
lot of dllimport test cases, so that is future work for now.
Fixes PR36125.
llvm-svn: 325375
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index fff714cb6aa..466a5d58e25 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -5857,7 +5857,7 @@ CharUnits ASTContext::getObjCEncodingTypeSize(QualType type) const { bool ASTContext::isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const { return getTargetInfo().getCXXABI().isMicrosoft() && VD->isStaticDataMember() && - VD->getType()->isIntegralOrEnumerationType() && + (VD->getType()->isIntegralOrEnumerationType() || VD->isConstexpr()) && !VD->getFirstDecl()->isOutOfLine() && VD->getFirstDecl()->hasInit(); } |