summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-02-16 19:44:47 +0000
committerReid Kleckner <rnk@google.com>2018-02-16 19:44:47 +0000
commitd23e73cda92fd4a4831568092c94b3ab24abe433 (patch)
tree2e057e7891d2fb53620f9035437f0d656a491615 /clang/lib/AST/ASTContext.cpp
parenta84485ed8d0f41e127a2e906ccd2c6dc99f512e1 (diff)
downloadbcm5719-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.cpp2
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();
}
OpenPOWER on IntegriCloud