diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-17 20:05:37 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-17 20:05:37 +0000 |
commit | 0348cfe40e6ee913e81b65e2d353db5f6d66281d (patch) | |
tree | b792f599a95e9e9c99eafb9d341efb9c07a208cb /lib/Sema/SemaDeclCXX.cpp | |
parent | 71b73d0a5c75298cd26bb44ef502dbe77fbe1289 (diff) |
Add an explicit derived class of FunctionDecl to model deduction guides rather
than just treating them as FunctionDecls with a funny name.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 6887962940..d28354f6e8 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -650,10 +650,11 @@ bool Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, // FIXME: It's not clear what should happen if multiple declarations of a // deduction guide have different explicitness. For now at least we simply // reject any case where the explicitness changes. - if (New->isDeductionGuide() && - New->isExplicitSpecified() != Old->isExplicitSpecified()) { + auto *NewGuide = dyn_cast<CXXDeductionGuideDecl>(New); + if (NewGuide && NewGuide->isExplicitSpecified() != + cast<CXXDeductionGuideDecl>(Old)->isExplicitSpecified()) { Diag(New->getLocation(), diag::err_deduction_guide_explicit_mismatch) - << New->isExplicitSpecified(); + << NewGuide->isExplicitSpecified(); Diag(Old->getLocation(), diag::note_previous_declaration); } |