summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-12-15 02:35:39 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-12-15 02:35:39 +0000
commitdfe85e2d88cdc7684abdeff6c91356d16a394849 (patch)
treee5ea9fc48a52df5963fb86670e19f2573a5c9e01 /clang/lib/AST/ExprConstant.cpp
parent81f5ade22790685efa5542bd8b7e7fb2c6b6c56c (diff)
downloadbcm5719-llvm-dfe85e2d88cdc7684abdeff6c91356d16a394849.tar.gz
bcm5719-llvm-dfe85e2d88cdc7684abdeff6c91356d16a394849.zip
[c++1z] Permit constant evaluation of a call through a function pointer whose
type differs from the type of the actual function due to having a different exception specification. llvm-svn: 289754
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 5dd493cfff5..36f5e6aae55 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -4434,8 +4434,11 @@ public:
}
// Don't call function pointers which have been cast to some other type.
- if (!Info.Ctx.hasSameType(CalleeType->getPointeeType(), FD->getType()))
+ // Per DR (no number yet), the caller and callee can differ in noexcept.
+ if (!Info.Ctx.hasSameFunctionTypeIgnoringExceptionSpec(
+ CalleeType->getPointeeType(), FD->getType())) {
return Error(E);
+ }
} else
return Error(E);
OpenPOWER on IntegriCloud