aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 06:25:27 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 06:25:27 +0000
commitd162584991885ab004a02573a73ce06422b921fc (patch)
tree0d8c56d85205a22c6c06b712a468afcd10429c4b /lib/Sema/SemaExprCXX.cpp
parentd9d22dd9c94618490dbffb0e2caf222530ca39d3 (diff)
Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a bunch of minor inconsistencies in the diagnostics emitted by clang and adds a bunch of FIXME's to DiagnosticKinds.def. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index f5f05f243c..3633da89bc 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -126,7 +126,7 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
//
if (!RT->getDecl()->isDefinition())
return Diag(TyBeginLoc, diag::err_invalid_incomplete_type_use)
- << Ty.getAsString() << FullRange;
+ << Ty << FullRange;
unsigned DiagID = PP.getDiagnostics().getCustomDiagID(Diagnostic::Error,
"class constructors are not supported yet");
@@ -164,7 +164,7 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
return Diag(TyBeginLoc, diag::err_value_init_for_array_type) << FullRange;
if (Ty->isIncompleteType() && !Ty->isVoidType())
return Diag(TyBeginLoc, diag::err_invalid_incomplete_type_use)
- << Ty.getAsString() << FullRange;
+ << Ty << FullRange;
return new CXXZeroInitValueExpr(Ty, TyBeginLoc, RParenLoc);
}
@@ -302,7 +302,7 @@ bool Sema::CheckAllocatedType(QualType AllocType, SourceLocation StartLoc,
assert(false && "Unexpected type class");
return true;
}
- Diag(StartLoc, msg) << AllocType.getAsString() << TyR;
+ Diag(StartLoc, msg) << AllocType << TyR;
return true;
}
@@ -340,18 +340,17 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
}
if (!Type->isPointerType()) {
- Diag(StartLoc, diag::err_delete_operand)
- << Type.getAsString() << Ex->getSourceRange();
+ Diag(StartLoc, diag::err_delete_operand) << Type << Ex->getSourceRange();
return true;
}
QualType Pointee = Type->getAsPointerType()->getPointeeType();
if (Pointee->isIncompleteType() && !Pointee->isVoidType())
Diag(StartLoc, diag::warn_delete_incomplete)
- << Pointee.getAsString() << Ex->getSourceRange();
+ << Pointee << Ex->getSourceRange();
else if (!Pointee->isObjectType()) {
Diag(StartLoc, diag::err_delete_operand)
- << Type.getAsString() << Ex->getSourceRange();
+ << Type << Ex->getSourceRange();
return true;
}
@@ -428,7 +427,7 @@ bool Sema::CheckCXXBooleanCondition(Expr *&CondExpr) {
ConvTy = CheckSingleAssignmentConstraints(Context.BoolTy, CondExpr);
if (ConvTy == Incompatible)
return Diag(CondExpr->getLocStart(), diag::err_typecheck_bool_condition)
- << Ty.getAsString() << CondExpr->getSourceRange();
+ << Ty << CondExpr->getSourceRange();
return false;
}