From 63168c75333b0c8dc74e337d71fe3411b2781577 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 10 Feb 2012 11:05:11 +0000 Subject: PR11684, core issue 1417: o Correct the handling of the restrictions on usage of cv-qualified and ref-qualified function types. o Fix a bug where such types were rejected in template type parameter default arguments, due to such arguments not being treated as a template type arg context. o Remove the ExtWarn for usage of such types as template arguments; that was a standard defect, not a GCC extension. o Improve the wording and unify the code for diagnosing cv-qualifiers with the code for diagnosing ref-qualifiers. llvm-svn: 150244 --- clang/lib/Sema/SemaDecl.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 3d24c592914..6ba3228b08a 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -4341,24 +4341,6 @@ bool Sema::CheckVariableDeclaration(VarDecl *NewVD, return false; } - // Function pointers and references cannot have qualified function type, only - // function pointer-to-members can do that. - QualType Pointee; - unsigned PtrOrRef = 0; - if (const PointerType *Ptr = T->getAs()) - Pointee = Ptr->getPointeeType(); - else if (const ReferenceType *Ref = T->getAs()) { - Pointee = Ref->getPointeeType(); - PtrOrRef = 1; - } - if (!Pointee.isNull() && Pointee->isFunctionProtoType() && - Pointee->getAs()->getTypeQuals() != 0) { - Diag(NewVD->getLocation(), diag::err_invalid_qualified_function_pointer) - << PtrOrRef; - NewVD->setInvalidDecl(); - return false; - } - if (!Previous.empty()) { MergeVarDecl(NewVD, Previous); return true; -- cgit v1.2.3