[llvm] [PowerPC][clang] Fix triple constructor ambiguity causing "unknown" target triple on AIX (PR #147488)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 02:17:30 PDT 2025


================
@@ -55,7 +55,7 @@ static std::string updateTripleOSVersion(std::string TargetTripleString) {
   // On AIX, the AIX version and release should be that of the current host
   // unless if the version has already been specified.
   if (Triple(LLVM_HOST_TRIPLE).getOS() == Triple::AIX) {
-    Triple TT(std::move(TargetTripleString));
+    Triple TT{Twine(TargetTripleString)};
----------------
nikic wrote:

Would just this work?
```suggestion
    Triple TT(TargetTripleString);
```
As far as I understand, the issue here was the incorrect use of std::move(), even though we can fall through to the `return TargetTripleString` case below (which would be an empty string after the move).

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


More information about the llvm-commits mailing list