diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-18 06:47:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-10-18 06:47:03 +0000 |
commit | 5988300c995e3c2db18117bfeb48fed8cdfc4211 (patch) | |
tree | a32914b10a1a0864fd04395e4dd04b38805d330a /lib/AST/Type.cpp | |
parent | 00c200807668c41c169a4cc29701d02de0c33bed (diff) |
[c++1z] Use canonical expression equivalence to determine whether two different
dependent noexcept specifications result in the same canonical function type.
We still use non-canonical hashing when deduplicating type sugar so that
diagnostics will point to the right place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 2601fa44cc..3e776e3043 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2850,7 +2850,7 @@ bool FunctionProtoType::isTemplateVariadic() const { void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result, const QualType *ArgTys, unsigned NumParams, const ExtProtoInfo &epi, - const ASTContext &Context) { + const ASTContext &Context, bool Canonical) { // We have to be careful not to get ambiguous profile encodings. // Note that valid type pointers are never ambiguous with anything else. @@ -2889,7 +2889,7 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result, ID.AddPointer(Ex.getAsOpaquePtr()); } else if (epi.ExceptionSpec.Type == EST_ComputedNoexcept && epi.ExceptionSpec.NoexceptExpr) { - epi.ExceptionSpec.NoexceptExpr->Profile(ID, Context, false); + epi.ExceptionSpec.NoexceptExpr->Profile(ID, Context, Canonical); } else if (epi.ExceptionSpec.Type == EST_Uninstantiated || epi.ExceptionSpec.Type == EST_Unevaluated) { ID.AddPointer(epi.ExceptionSpec.SourceDecl->getCanonicalDecl()); @@ -2905,7 +2905,7 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result, void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx) { Profile(ID, getReturnType(), param_type_begin(), NumParams, getExtProtoInfo(), - Ctx); + Ctx, isCanonicalUnqualified()); } QualType TypedefType::desugar() const { |