Skip to content

Commit a4ee55f

Browse files
alexbatashevAlexander Batashev
and
Alexander Batashev
authored
[MLIR][NFC] Fix build on recent GCC with C++20 enabled (llvm#73308)
The following pattern fails on recent GCC versions with -std=c++20 flag passed and succeeds with -std=c++17. Such behavior is not observed on Clang 16.0. ``` template <typename T> struct Foo { Foo<T>(int a) {} }; ``` This patch removes template parameter from constructor in two occurences to make the following command complete successfully: bazel build -c fastbuild --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 @llvm-project//mlir/... This patch is similar to https://reviews.llvm.org/D154782 Co-authored-by: Alexander Batashev <[email protected]>
1 parent 6bdeb53 commit a4ee55f

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ template <typename Op, typename TypeResolver = ComplexTypeResolver>
5555
struct ScalarOpToLibmCall : public OpRewritePattern<Op> {
5656
public:
5757
using OpRewritePattern<Op>::OpRewritePattern;
58-
ScalarOpToLibmCall<Op, TypeResolver>(MLIRContext *context,
59-
StringRef floatFunc,
60-
StringRef doubleFunc,
61-
PatternBenefit benefit)
58+
ScalarOpToLibmCall(MLIRContext *context, StringRef floatFunc,
59+
StringRef doubleFunc, PatternBenefit benefit)
6260
: OpRewritePattern<Op>(context, benefit), floatFunc(floatFunc),
6361
doubleFunc(doubleFunc){};
6462

mlir/lib/Conversion/MathToLibm/MathToLibm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ template <typename Op>
5050
struct ScalarOpToLibmCall : public OpRewritePattern<Op> {
5151
public:
5252
using OpRewritePattern<Op>::OpRewritePattern;
53-
ScalarOpToLibmCall<Op>(MLIRContext *context, StringRef floatFunc,
54-
StringRef doubleFunc)
53+
ScalarOpToLibmCall(MLIRContext *context, StringRef floatFunc,
54+
StringRef doubleFunc)
5555
: OpRewritePattern<Op>(context), floatFunc(floatFunc),
5656
doubleFunc(doubleFunc){};
5757

mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ Region::iterator getBlockIt(Region &region, unsigned index) {
9696
template <typename OpTy>
9797
class SCFToSPIRVPattern : public OpConversionPattern<OpTy> {
9898
public:
99-
SCFToSPIRVPattern<OpTy>(MLIRContext *context, SPIRVTypeConverter &converter,
100-
ScfToSPIRVContextImpl *scfToSPIRVContext)
99+
SCFToSPIRVPattern(MLIRContext *context, SPIRVTypeConverter &converter,
100+
ScfToSPIRVContextImpl *scfToSPIRVContext)
101101
: OpConversionPattern<OpTy>::OpConversionPattern(converter, context),
102102
scfToSPIRVContext(scfToSPIRVContext), typeConverter(converter) {}
103103

mlir/lib/Pass/PassRegistry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ llvm::cl::OptionValue<OpPassManager>::operator=(
373373
return *this;
374374
}
375375

376-
llvm::cl::OptionValue<OpPassManager>::~OptionValue<OpPassManager>() = default;
376+
llvm::cl::OptionValue<OpPassManager>::~OptionValue() = default;
377377

378378
void llvm::cl::OptionValue<OpPassManager>::setValue(
379379
const OpPassManager &newValue) {

0 commit comments

Comments
 (0)