================
@@ -7909,6 +7903,37 @@ bool 
Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
                                          Arg.getLocation());
 }
 
+static Sema::SemaDiagnosticBuilder noteLocation(Sema &S, const NamedDecl &Decl,
+                                                unsigned HereDiagID,
+                                                unsigned ExternalDiagID) {
+  if (Decl.getLocation().isValid())
+    return S.Diag(Decl.getLocation(), HereDiagID);
+
+  SmallString<128> Str;
+  llvm::raw_svector_ostream Out(Str);
+  PrintingPolicy PP = S.getPrintingPolicy();
+  PP.TerseOutput = 1;
+  Decl.print(Out, PP);
+  return S.Diag(Decl.getLocation(), ExternalDiagID) << Out.str();
----------------
bogner wrote:

Using `<< &Decl` here just gives the name. With print we get:
```
template declaration from hidden source: template <class element = float, int 
element_count = 4> using vector = element 
__attribute__((ext_vector_type(element_count)))
template parameter from hidden source: class element = float
```
whereas with the stream operator it's
```
note: template declaration from hidden source: 'vector'
note: template parameter from hidden source: 'element'
```

Similarly in #71265 it's the difference between printing `template <class 
element_type> class RWBuffer final` vs just `RWBuffer`

https://github.com/llvm/llvm-project/pull/71264
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to