-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[clang] constexpr template method cannot be used in a constant expression #107018
Comments
@llvm/issue-subscribers-clang-frontend Author: Pavel Korotkevich (Pawday)
# [Online example](https://godbolt.org/z/qzaaGfe5h)
```c++
struct ConstexprTemplate
{
static constexpr int sizeof_char()
{
return sizeof_template<char>();
}
}; constexpr int sizeof_char = ConstexprTemplate::sizeof_char();
|
I think this is another case of constant evaluation not causing template instantiation. CC @cor3ntin |
This comment was marked as off-topic.
This comment was marked as off-topic.
Synthesize `zero_constant` and `multivector` overloads from a complete type providing `blade` overloads. This is used to workaround issues with instantiation of function templates in constant expressions that occur when moving the wedge implementation. llvm/llvm-project#107018 Change-Id: Iff177db6ad201a07f1f36d5d668c4ffcd4abff9a
Synthesize `zero_constant` and `multivector` overloads from a complete type providing `blade` overloads. This is used to workaround issues with instantiation of function templates in constant expressions that occur when moving the wedge implementation. llvm/llvm-project#107018 Change-Id: Iff177db6ad201a07f1f36d5d668c4ffcd4abff9a
Online example
clang version 18.1.8 ([email protected]:llvm/llvm-project.git 3b5b5c1)
Full diagnostic message:
The text was updated successfully, but these errors were encountered: