llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jackson Stogel (jtstogel)

<details>
<summary>Changes</summary>

After a68ae7b0cc0922b79114aabe8cf1ec8dc68524d7, calling `&lt;&lt;` with a 
`std::string_view` gives:

```
clang/include/clang/Basic/Diagnostic.h:1319:8: error: use of overloaded 
operator '&lt;&lt;' is ambiguous (with operand types 'const 
StreamingDiagnostic' and 'const std::string_view')
 1319 |     DB &lt;&lt; V;
      |     ~~ ^  ~
```

---
Full diff: https://github.com/llvm/llvm-project/pull/190374.diff


1 Files Affected:

- (modified) clang/include/clang/Basic/Diagnostic.h (+6) 


``````````diff
diff --git a/clang/include/clang/Basic/Diagnostic.h 
b/clang/include/clang/Basic/Diagnostic.h
index 5a6f5fd61a5db..6dc2eb040c9ca 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -1374,6 +1374,12 @@ inline const StreamingDiagnostic &operator<<(const 
StreamingDiagnostic &DB,
   return DB;
 }
 
+inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
+                                             std::string_view S) {
+  DB.AddString(S);
+  return DB;
+}
+
 inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
                                              const std::string &S) {
   DB.AddString(S);

``````````

</details>


https://github.com/llvm/llvm-project/pull/190374
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to