[cfe-commits] r110312 - /cfe/trunk/lib/AST/TemplateBase.cpp
John McCall
rjmccall at apple.com
Wed Aug 4 21:58:04 PDT 2010
Author: rjmccall
Date: Wed Aug 4 23:58:04 2010
New Revision: 110312
URL: http://llvm.org/viewvc/llvm-project?rev=110312&view=rev
Log:
operator<< on a DiagnosticBuilder should *always* output exactly one thing.
Null template arguments are bad, but they're better than crashing with an
argument mismatch.
Modified:
cfe/trunk/lib/AST/TemplateBase.cpp
Modified: cfe/trunk/lib/AST/TemplateBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TemplateBase.cpp?rev=110312&r1=110311&r2=110312&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TemplateBase.cpp (original)
+++ cfe/trunk/lib/AST/TemplateBase.cpp Wed Aug 4 23:58:04 2010
@@ -152,7 +152,9 @@
const TemplateArgument &Arg) {
switch (Arg.getKind()) {
case TemplateArgument::Null:
- return DB;
+ // This is bad, but not as bad as crashing because of argument
+ // count mismatches.
+ return DB << "(null template argument)";
case TemplateArgument::Type:
return DB << Arg.getAsType();
More information about the cfe-commits
mailing list