summaryrefslogtreecommitdiffstats
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-02-19 14:07:28 +0000
committerHans Wennborg <hans@hanshq.net>2018-02-19 14:07:28 +0000
commitd535c7497ba16b93fc49b1587d10d32ea44e61a4 (patch)
treedf473c6a5a2c349973694336f4f175425f874b9f /lib/AST/ASTContext.cpp
parentb092852c1d76878d1e43bd539e9ae0af146e80e0 (diff)
Merging r325375:
------------------------------------------------------------------------ r325375 | rnk | 2018-02-16 20:44:47 +0100 (Fri, 16 Feb 2018) | 11 lines [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. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_60@325500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c73ae9efe1..94af21d4be 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -5854,7 +5854,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();
}