diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-10 11:05:11 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-10 11:05:11 +0000 |
commit | 63168c75333b0c8dc74e337d71fe3411b2781577 (patch) | |
tree | ccb5aebfa88fde0b5af9dee035c3cef23fe0a72f /clang/lib/Sema/SemaDecl.cpp | |
parent | d98937b011eeefa7c4fd31480e9fdc8f7b85e575 (diff) | |
download | bcm5719-llvm-63168c75333b0c8dc74e337d71fe3411b2781577.tar.gz bcm5719-llvm-63168c75333b0c8dc74e337d71fe3411b2781577.zip |
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
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
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<PointerType>()) - Pointee = Ptr->getPointeeType(); - else if (const ReferenceType *Ref = T->getAs<ReferenceType>()) { - Pointee = Ref->getPointeeType(); - PtrOrRef = 1; - } - if (!Pointee.isNull() && Pointee->isFunctionProtoType() && - Pointee->getAs<FunctionProtoType>()->getTypeQuals() != 0) { - Diag(NewVD->getLocation(), diag::err_invalid_qualified_function_pointer) - << PtrOrRef; - NewVD->setInvalidDecl(); - return false; - } - if (!Previous.empty()) { MergeVarDecl(NewVD, Previous); return true; |