diff options
author | John McCall <rjmccall@apple.com> | 2010-08-05 04:58:04 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-05 04:58:04 +0000 |
commit | 67c4a0ca65dd72784a1778264938c8ba45506cea (patch) | |
tree | 1a9b3910227757912a777595b8211c4824da744f /lib/AST/TemplateBase.cpp | |
parent | a9c76216c9d055b7161fdbe78f531e5f7fcd4f1e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TemplateBase.cpp')
-rw-r--r-- | lib/AST/TemplateBase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp index 02e648879a..351aebe3f8 100644 --- a/lib/AST/TemplateBase.cpp +++ b/lib/AST/TemplateBase.cpp @@ -152,7 +152,9 @@ const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB, 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(); |