Skip to content

Commit 1037414

Browse files
jaladreipssys-ce-bb
authored andcommitted
Fix potential constructor ambiguity in BuiltinCallMutator::ValueTypePair (#3268)
BuiltinCallMutator::ValueTypePair defines its own constructor with arguments (llvm::Value *V, llvm::Type *T) BuiltinCallMutator::ValueTypePair also uses std::pair constructor with arguments (llvm::Value *&V, llvm::Type *&T) This causes an ambiguity that confuses GCC when compiling for C++20. Issue repro on goldbolt: https://godbolt.org/z/MTnvx6E6T There are multiple possible fixes. I think the one with the least impact is to change BuiltinCallMutator::ValueTypePair constructor signature to conform with std::pair constructor signature. Fixed version: https://godbolt.org/z/49WzvjK63 Other possibility is to remove the constructors that are redundant. But maybe they are very important. Original commit: KhronosGroup/SPIRV-LLVM-Translator@9413a66e04ba34f
1 parent 70cb5e1 commit 1037414

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

llvm-spirv/lib/SPIRV/SPIRVBuiltinHelper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class BuiltinCallMutator {
139139
"Must specify a pointer element type if value is a pointer.");
140140
}
141141
ValueTypePair(std::pair<llvm::Value *, llvm::Type *> P) : pair(P) {}
142-
ValueTypePair(llvm::Value *V, llvm::Type *T) : pair(V, T) {}
143142
ValueTypePair() = delete;
144143
using pair::pair;
145144
};

0 commit comments

Comments
 (0)