aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-10 20:44:00 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-10 20:44:00 +0000
commitdf667e71b1daadeacb230cf94fc717843f1a138a (patch)
tree72ebde19e19176d2cc776ce1dab15dc5c6e0d5c3 /include
parent27b152fa7443f4e24630b997c07def6b0c23925a (diff)
Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default template arguments. In the TextDiagnosticPrinter, don't suppress the caret diagnostic if we are producing a non-note diagnostic that follows a note diagnostic with the same location, because notes are (conceptually) a part of the warning or error that comes before them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/Type.h5
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.def2
-rw-r--r--include/clang/Frontend/TextDiagnosticPrinter.h5
3 files changed, 10 insertions, 2 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 1c0a081c45..2487da61c8 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -1449,6 +1449,11 @@ public:
static bool anyDependentTemplateArguments(const TemplateArgument *Args,
unsigned NumArgs);
+ /// \brief Print a template argument list, including the '<' and '>'
+ /// enclosing the template arguments.
+ static std::string PrintTemplateArgumentList(const TemplateArgument *Args,
+ unsigned NumArgs);
+
typedef const TemplateArgument * iterator;
iterator begin() const { return getArgs(); }
diff --git a/include/clang/Basic/DiagnosticSemaKinds.def b/include/clang/Basic/DiagnosticSemaKinds.def
index 46d81445b6..271e14d8a1 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.def
+++ b/include/clang/Basic/DiagnosticSemaKinds.def
@@ -649,6 +649,8 @@ DIAG(err_template_implicit_instantiate_undefined, ERROR,
"implicit instantiation of undefined template %0")
DIAG(note_template_class_instantiation_here, NOTE,
"in instantiation of template class %0 requested here")
+DIAG(note_default_arg_instantiation_here, NOTE,
+ "in instantiation of default argument for '%0' required here")
DIAG(err_unexpected_typedef, ERROR,
"unexpected type name %0: expected expression")
diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h
index c9fbae6ebb..eeff279513 100644
--- a/include/clang/Frontend/TextDiagnosticPrinter.h
+++ b/include/clang/Frontend/TextDiagnosticPrinter.h
@@ -28,6 +28,7 @@ class SourceManager;
class TextDiagnosticPrinter : public DiagnosticClient {
SourceLocation LastWarningLoc;
FullSourceLoc LastLoc;
+ bool LastCaretDiagnosticWasNote;
llvm::raw_ostream &OS;
bool ShowColumn;
bool CaretDiagnostics;
@@ -35,8 +36,8 @@ class TextDiagnosticPrinter : public DiagnosticClient {
public:
TextDiagnosticPrinter(llvm::raw_ostream &os, bool showColumn = true,
bool caretDiagnistics = true, bool showLocation = true)
- : OS(os), ShowColumn(showColumn), CaretDiagnostics(caretDiagnistics),
- ShowLocation(showLocation) {}
+ : LastCaretDiagnosticWasNote(false), OS(os), ShowColumn(showColumn),
+ CaretDiagnostics(caretDiagnistics), ShowLocation(showLocation) {}
void PrintIncludeStack(SourceLocation Loc, const SourceManager &SM);