summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 17:50:36 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 17:50:36 +0000
commit4bd25fda3f577f5c23687e7559a4f8af1d4db6c1 (patch)
tree813320a891524e52f4bbb168fb3e1dfb941b8277 /lib/CodeGen/CGExpr.cpp
parent3baecdc25147b80e37d07eb72d0e8beae72b601a (diff)
downloadclang-4bd25fda3f577f5c23687e7559a4f8af1d4db6c1.tar.gz
For DR712: store on a MemberExpr whether it constitutes an odr-use.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 46b1af5e1c..c1c9af0ddd 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1492,17 +1492,11 @@ CodeGenFunction::tryEmitAsConstant(DeclRefExpr *refExpr) {
static DeclRefExpr *tryToConvertMemberExprToDeclRefExpr(CodeGenFunction &CGF,
const MemberExpr *ME) {
if (auto *VD = dyn_cast<VarDecl>(ME->getMemberDecl())) {
- // FIXME: Copy this from the MemberExpr once we store it there.
- NonOdrUseReason NOUR = NOUR_None;
- if (VD->getType()->isReferenceType() &&
- VD->isUsableInConstantExpressions(CGF.getContext()))
- NOUR = NOUR_Constant;
-
// Try to emit static variable member expressions as DREs.
return DeclRefExpr::Create(
CGF.getContext(), NestedNameSpecifierLoc(), SourceLocation(), VD,
/*RefersToEnclosingVariableOrCapture=*/false, ME->getExprLoc(),
- ME->getType(), ME->getValueKind(), nullptr, nullptr, NOUR);
+ ME->getType(), ME->getValueKind(), nullptr, nullptr, ME->isNonOdrUse());
}
return nullptr;
}