summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.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/ASTContext.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/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 22be71a7272..73ea66e98e8 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2382,6 +2382,14 @@ static QualType getFunctionTypeWithExceptionSpec(
Proto->getExtProtoInfo().withExceptionSpec(ESI));
}
+bool ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(QualType T,
+ QualType U) {
+ return hasSameType(T, U) ||
+ (getLangOpts().CPlusPlus1z &&
+ hasSameType(getFunctionTypeWithExceptionSpec(*this, T, EST_None),
+ getFunctionTypeWithExceptionSpec(*this, U, EST_None)));
+}
+
void ASTContext::adjustExceptionSpec(
FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI,
bool AsWritten) {
OpenPOWER on IntegriCloud