[all-commits] [llvm/llvm-project] b31ee8: [mlir] Use default RemarkOpts constructor for c++2...
Jordan Rupprecht via All-commits
all-commits at lists.llvm.org
Fri Aug 22 07:39:02 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b31ee8ee07b7929da8988bf8ecf5a53241292e9b
https://github.com/llvm/llvm-project/commit/b31ee8ee07b7929da8988bf8ecf5a53241292e9b
Author: Jordan Rupprecht <rupprecht at google.com>
Date: 2025-08-22 (Fri, 22 Aug 2025)
Changed paths:
M mlir/include/mlir/IR/Remarks.h
Log Message:
-----------
[mlir] Use default RemarkOpts constructor for c++20 compat (#154887)
Using the default constructor makes this header work in both c++17 and
c++20 codebases. Without this, a c++20 codebase will break like this:
```c++
external/llvm-project/mlir/include/mlir/IR/Remarks.h:66:12: error: no matching constructor for initialization of 'RemarkOpts'
66 | return RemarkOpts{n, {}, {}, {}};
| ^ ~~~~~~~~~~~~~~~
external/llvm-project/mlir/include/mlir/IR/Remarks.h:58:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 4 were provided
58 | struct RemarkOpts {
| ^~~~~~~~~~
external/llvm-project/mlir/include/mlir/IR/Remarks.h:58:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 4 were provided
58 | struct RemarkOpts {
| ^~~~~~~~~~
external/llvm-project/mlir/include/mlir/IR/Remarks.h:63:3: note: candidate constructor not viable: requires 0 arguments, but 4 were provided
63 | RemarkOpts() = delete;
| ^
external/llvm-project/mlir/include/mlir/IR/Remarks.h:65:31: error: constexpr function's return type 'RemarkOpts' is not a literal type
65 | static constexpr RemarkOpts name(StringRef n) {
| ^
external/llvm-project/mlir/include/mlir/IR/Remarks.h:58:8: note: 'RemarkOpts' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
58 | struct RemarkOpts {
| ^
```
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list