diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-11 17:50:32 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-06-11 17:50:32 +0000 |
commit | 715f7a1bd058c64a39cc4773114dfb46ae8cc8a3 (patch) | |
tree | d9f4369bedcbe50c9dc03ee5498544702d86616e /clang/lib/CodeGen/CGDecl.cpp | |
parent | ef2d6d99c0d35e46dce7fff6b999a3a1fc08aecc (diff) | |
download | bcm5719-llvm-715f7a1bd058c64a39cc4773114dfb46ae8cc8a3.tar.gz bcm5719-llvm-715f7a1bd058c64a39cc4773114dfb46ae8cc8a3.zip |
For DR712: store on a DeclRefExpr whether it constitutes an odr-use.
Begin restructuring to support the forms of non-odr-use reference
permitted by DR712.
llvm-svn: 363086
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 61f9de9a292..db18ac49c6e 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -1783,8 +1783,8 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) { } llvm::Constant *constant = nullptr; - if (emission.IsConstantAggregate || D.isConstexpr() || - D.isUsableInConstantExpressions(getContext())) { + if (emission.IsConstantAggregate || + D.mightBeUsableInConstantExpressions(getContext())) { assert(!capturedByInit && "constant init contains a capturing block?"); constant = ConstantEmitter(*this).tryEmitAbstractForInitializer(D); if (constant && !constant->isZeroValue() && |