diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-10 02:19:05 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-10 02:19:05 +0000 |
commit | 1ef9dbfbac798d6e09edda41da9ce95537dfdd4e (patch) | |
tree | b8b75ca89829ab80391c9577db6297dbc909821d /lib/Sema/SemaDeclCXX.cpp | |
parent | f3d1012f55f9010e65764115f6933cb61a99d07f (diff) |
[c++1z] P0512R0: support for 'explicit' specifier on deduction-guides.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 9ba2091bb2..0acf91d3d0 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -647,6 +647,16 @@ bool Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Invalid = true; } + // 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()) { + Diag(New->getLocation(), diag::err_deduction_guide_explicit_mismatch) + << New->isExplicitSpecified(); + Diag(Old->getLocation(), diag::note_previous_declaration); + } + // C++11 [dcl.fct.default]p4: If a friend declaration specifies a default // argument expression, that declaration shall be a definition and shall be // the only declaration of the function or function template in the |