forked from OSchip/llvm-project
[Clang] NFC: Remove duplicated variable def in CheckLValueConstantExpression
This commit is contained in:
parent
10edf88458
commit
0e8afddaa1
|
@ -2174,12 +2174,10 @@ static bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc,
|
|||
// assumed to be global here.
|
||||
if (!IsGlobalLValue(Base)) {
|
||||
if (Info.getLangOpts().CPlusPlus11) {
|
||||
const ValueDecl *VD = Base.dyn_cast<const ValueDecl*>();
|
||||
Info.FFDiag(Loc, diag::note_constexpr_non_global, 1)
|
||||
<< IsReferenceType << !Designator.Entries.empty()
|
||||
<< !!VD << VD;
|
||||
|
||||
auto *VarD = dyn_cast_or_null<VarDecl>(VD);
|
||||
<< IsReferenceType << !Designator.Entries.empty() << !!BaseVD
|
||||
<< BaseVD;
|
||||
auto *VarD = dyn_cast_or_null<VarDecl>(BaseVD);
|
||||
if (VarD && VarD->isConstexpr()) {
|
||||
// Non-static local constexpr variables have unintuitive semantics:
|
||||
// constexpr int a = 1;
|
||||
|
|
Loading…
Reference in New Issue