| Issue |
185109
|
| Summary |
[[clang::lifetimebound]] interferes with CRTP due to unexpected template instantiations
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
higher-performance
|
This fails to compile: https://godbolt.org/z/e7W7raqsf
```
template <class Derived>
class CRTP {
char* foo() & noexcept(noexcept(static_cast<Derived*>(nullptr)->bar()))
[[clang::lifetimebound]];
};
struct S : CRTP<S> { char* bar(); };
```
However, if `[[clang::lifetimebound]]` is commented out, it compiles fine.
I'm not sure if the code is otherwise permitted to compile by the standard or not, but this prevents the usage of `lifetimebound` with `noexcept` and [CRTP](https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern), and feels like it should be avoidable.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs