From 5b8b3db5c941dc03c1fa307a04f93729889a656b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 20 Feb 2012 23:28:05 +0000 Subject: Fix a constexpr FIXME: When implicitly instantiating the primary template for an explicit specialization of a function template, mark the instantiation as constexpr if the specialization is, rather than requiring them to match. llvm-svn: 151001 --- clang/lib/Sema/SemaDeclCXX.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'clang/lib/Sema/SemaDeclCXX.cpp') diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 48dc911b6a3..faf2c41853b 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -516,13 +516,9 @@ bool Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old) { } } - // C++0x [dcl.constexpr]p1: If any declaration of a function or function + // C++11 [dcl.constexpr]p1: If any declaration of a function or function // template has a constexpr specifier then all its declarations shall - // contain the constexpr specifier. [Note: An explicit specialization can - // differ from the template declaration with respect to the constexpr - // specifier. -- end note] - // - // FIXME: Don't reject changes in constexpr in explicit specializations. + // contain the constexpr specifier. if (New->isConstexpr() != Old->isConstexpr()) { Diag(New->getLocation(), diag::err_constexpr_redecl_mismatch) << New << New->isConstexpr(); -- cgit v1.2.3