Skip to content

[mlir][NFC] Avoid a warning #114052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2024
Merged

[mlir][NFC] Avoid a warning #114052

merged 1 commit into from
Oct 29, 2024

Conversation

pfusik
Copy link
Contributor

@pfusik pfusik commented Oct 29, 2024

warning: template-id not allowed for destructor in C++20 [-Wtemplate-id-cdtor]

warning: template-id not allowed for destructor in C++20 [-Wtemplate-id-cdtor]
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Oct 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 29, 2024

@llvm/pr-subscribers-mlir-core

@llvm/pr-subscribers-mlir

Author: Piotr Fusik (pfusik)

Changes

warning: template-id not allowed for destructor in C++20 [-Wtemplate-id-cdtor]


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

1 Files Affected:

  • (modified) mlir/lib/Pass/PassRegistry.cpp (+1-1)
diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index fe842755958418..029512fd3ecc11 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -422,7 +422,7 @@ llvm::cl::OptionValue<OpPassManager>::operator=(
   return *this;
 }
 
-llvm::cl::OptionValue<OpPassManager>::~OptionValue<OpPassManager>() = default;
+llvm::cl::OptionValue<OpPassManager>::~OptionValue() = default;
 
 void llvm::cl::OptionValue<OpPassManager>::setValue(
     const OpPassManager &newValue) {

@pfusik pfusik requested a review from banach-space October 29, 2024 13:32
Copy link
Contributor

@banach-space banach-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix and for preparing the codebase for a transition to C++20 :)

[nit] Add a note saying which compiler makes this a warning (gcc? clang? and version)

@pfusik pfusik merged commit c370869 into llvm:main Oct 29, 2024
11 checks passed
@pfusik
Copy link
Contributor Author

pfusik commented Oct 29, 2024

LGTM, thanks for the fix and for preparing the codebase for a transition to C++20 :)

[nit] Add a note saying which compiler makes this a warning (gcc? clang? and version)

Added in the commit message. gcc 14.1 and 14.2 emit this warning even without -std=c++20: https://godbolt.org/z/r4P7rqEb7

@joker-eph
Copy link
Collaborator

Thanks for the fix!

NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
gcc 14.1 warning: template-id not allowed for destructor in C++20
[-Wtemplate-id-cdtor]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants