Ignore implicit things like ConstantExpr.

llvm-svn: 346461
This commit is contained in:
Bill Wendling 2018-11-09 01:32:30 +00:00
parent 86ef28f1a2
commit ec54d6121c
1 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,8 @@ void NoexceptMoveConstructorCheck::check(
// where expr evaluates to false.
if (ProtoType->canThrow() == CT_Can) {
Expr *E = ProtoType->getNoexceptExpr();
if (!isa<CXXBoolLiteralExpr>(ProtoType->getNoexceptExpr())) {
E = E->IgnoreImplicit();
if (!isa<CXXBoolLiteralExpr>(E)) {
diag(E->getExprLoc(),
"noexcept specifier on the move %0 evaluates to 'false'")
<< MethodType;