diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-15 02:35:39 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-15 02:35:39 +0000 |
| commit | dfe85e2d88cdc7684abdeff6c91356d16a394849 (patch) | |
| tree | e5ea9fc48a52df5963fb86670e19f2573a5c9e01 /clang/lib/AST/ASTContext.cpp | |
| parent | 81f5ade22790685efa5542bd8b7e7fb2c6b6c56c (diff) | |
| download | bcm5719-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.cpp | 8 |
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) { |

