diff options
author | Chris Bieneman <chris.bieneman@me.com> | 2019-05-17 05:46:03 +0000 |
---|---|---|
committer | Chris Bieneman <chris.bieneman@me.com> | 2019-05-17 05:46:03 +0000 |
commit | a971003e46774281f768c7f59c575827f60f27b4 (patch) | |
tree | 3ca250ccea8ff242661c8c36c136b7369e119585 /clang/lib/Sema/SemaTemplate.cpp | |
parent | a5a4124c494ce08a9decb96d2be94e7f216bedbd (diff) | |
download | bcm5719-llvm-a971003e46774281f768c7f59c575827f60f27b4.tar.gz bcm5719-llvm-a971003e46774281f768c7f59c575827f60f27b4.zip |
Revert Refactor constant evaluation of typeid(T) to track a symbolic type_info object rather than tracking the originating expression.
This reverts r360974 (git commit 7ee4307bd4450022c3c8777f43a40cc4f0ccc009)
llvm-svn: 360988
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 239b4ae7957..b9d3ff8666f 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -6424,11 +6424,8 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // -- a string literal // -- the result of a typeid expression, or // -- a predefined __func__ variable - APValue::LValueBase Base = Value.getLValueBase(); - auto *VD = const_cast<ValueDecl *>(Base.dyn_cast<const ValueDecl *>()); - if (Base && !VD) { - auto *E = Base.dyn_cast<const Expr *>(); - if (E && isa<CXXUuidofExpr>(E)) { + if (auto *E = Value.getLValueBase().dyn_cast<const Expr*>()) { + if (isa<CXXUuidofExpr>(E)) { Converted = TemplateArgument(ArgResult.get()->IgnoreImpCasts()); break; } @@ -6436,6 +6433,8 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, << Arg->getSourceRange(); return ExprError(); } + auto *VD = const_cast<ValueDecl *>( + Value.getLValueBase().dyn_cast<const ValueDecl *>()); // -- a subobject if (Value.hasLValuePath() && Value.getLValuePath().size() == 1 && VD && VD->getType()->isArrayType() && |