summaryrefslogtreecommitdiff
path: root/lib/AST/TemplateName.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2019-05-03 00:44:50 +0000
committerDavid Blaikie <dblaikie@gmail.com>2019-05-03 00:44:50 +0000
commit6aecacbb8d3d7322d588b528a34a0425444dfafd (patch)
treef04375d141a02ecfec4c8b535096efa564ebed00 /lib/AST/TemplateName.cpp
parentb4f79aa4368802682268e2f39a29dd8f9b107b59 (diff)
downloadclang-6aecacbb8d3d7322d588b528a34a0425444dfafd.tar.gz
SemaOverload: Complete candidates before emitting the error, to ensure diagnostics emitted (or suppressed) during completion don't interfere with the overload notes
Because diagnostics and their notes are not connected at the API level, if the error message for an overload is emitted, then the overload candidates are completed - if a diagnostic is emitted during that work, the notes related to overload candidates would be attached to the latter diagnostic, not the original error. Sort of worse, if the latter diagnostic was disabled, the notes are disabled. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D61357 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TemplateName.cpp')
-rw-r--r--lib/AST/TemplateName.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/AST/TemplateName.cpp b/lib/AST/TemplateName.cpp
index b3c44f6d03..2474d6278b 100644
--- a/lib/AST/TemplateName.cpp
+++ b/lib/AST/TemplateName.cpp
@@ -250,6 +250,20 @@ const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB,
return DB << NameStr;
}
+const PartialDiagnostic&clang::operator<<(const PartialDiagnostic &PD,
+ TemplateName N) {
+ std::string NameStr;
+ llvm::raw_string_ostream OS(NameStr);
+ LangOptions LO;
+ LO.CPlusPlus = true;
+ LO.Bool = true;
+ OS << '\'';
+ N.print(OS, PrintingPolicy(LO));
+ OS << '\'';
+ OS.flush();
+ return PD << NameStr;
+}
+
void TemplateName::dump(raw_ostream &OS) const {
LangOptions LO; // FIXME!
LO.CPlusPlus = true;