Give CanQual<T> an implicit conversion to bool, so that it can be used
in "if" statements like: if (CanQual<ReferenceType> RefType = T.getAs<ReferenceType>()) Thanks to Clang for pointing out this mistake :) llvm-svn: 86995
This commit is contained in:
parent
a70ad93f8a
commit
6051c8d344
|
@ -71,6 +71,9 @@ public:
|
|||
/// \brief Implicit conversion to a qualified type.
|
||||
operator QualType() const { return Stored; }
|
||||
|
||||
/// \brief Implicit conversion to bool.
|
||||
operator bool() const { return !isNull(); }
|
||||
|
||||
bool isNull() const {
|
||||
return Stored.isNull();
|
||||
}
|
||||
|
|
|
@ -4014,7 +4014,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
|
|||
if (!ResultTy->isDependentType() && ResultTy != Context.VoidPtrTy)
|
||||
return Diag(FnDecl->getLocation(),
|
||||
diag::err_operator_new_result_type) << FnDecl->getDeclName()
|
||||
<< Context.VoidPtrTy;
|
||||
<< static_cast<QualType>(Context.VoidPtrTy);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue