[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 25 21:47:22 PDT 2025


================
@@ -349,7 +350,12 @@ class Triple {
   /// triple fields unknown.
   Triple() = default;
 
+  LLVM_ABI explicit Triple(std::string &&Str);
+  explicit Triple(StringRef Str) : Triple(Str.str()) {}
+  explicit Triple(const char *Str) : Triple(std::string(Str)) {}
+  explicit Triple(const std::string &Str) : Triple(std::string(Str)) {}
----------------
arsenm wrote:

This avoids ambiguous conversion to Twine or StringRef

https://github.com/llvm/llvm-project/pull/145685


More information about the cfe-commits mailing list