diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-14 05:37:29 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-14 05:37:29 +0000 |
commit | 21c8fa87a3517d835072193a59a955ec7f6bf408 (patch) | |
tree | 1bd5c804197cdc7053895c89feb7b27aa4b1f320 /lib/Sema/SemaType.cpp | |
parent | 7b19cb116d0909de72dc8242b0a4e6c5ed39d421 (diff) |
PR12008: defer adding the implicit 'const' to a constexpr member function until
we know whether it is static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index f44603b1ef..930d98d44a 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -2690,30 +2690,6 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, FreeFunction = (DC && !DC->isRecord()); } - // C++0x [dcl.constexpr]p8: A constexpr specifier for a non-static member - // function that is not a constructor declares that function to be const. - // FIXME: This should be deferred until we know whether this is a static - // member function (for an out-of-class definition, we don't know - // this until we perform redeclaration lookup). - if (D.getDeclSpec().isConstexprSpecified() && !FreeFunction && - D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_static && - D.getName().getKind() != UnqualifiedId::IK_ConstructorName && - D.getName().getKind() != UnqualifiedId::IK_ConstructorTemplateId && - !(FnTy->getTypeQuals() & DeclSpec::TQ_const)) { - // Rebuild function type adding a 'const' qualifier. - FunctionProtoType::ExtProtoInfo EPI = FnTy->getExtProtoInfo(); - EPI.TypeQuals |= DeclSpec::TQ_const; - T = Context.getFunctionType(FnTy->getResultType(), - FnTy->arg_type_begin(), - FnTy->getNumArgs(), EPI); - // Rebuild any parens around the identifier in the function type. - for (unsigned i = 0, e = D.getNumTypeObjects(); i != e; ++i) { - if (D.getTypeObject(i).Kind != DeclaratorChunk::Paren) - break; - T = S.BuildParenType(T); - } - } - // C++11 [dcl.fct]p6 (w/DR1417): // An attempt to specify a function type with a cv-qualifier-seq or a // ref-qualifier (including by typedef-name) is ill-formed unless it is: |