-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
c++26clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid
Description
Consider (https://godbolt.org/z/3ThcG9r9d):
template <typename... opts>
struct temp {
template <unsigned idx>
static constexpr __SIZE_TYPE__ get_index() { return idx; }
template <unsigned s>
static auto x() -> opts...[get_index<s>()] {}
};
Attempting to call x
like this
temp<void>::x<0>();
fails with the following (rather weird) error:
<source>:11:5: error: no matching function for call to 'x'
11 | temp<void>::x<0>(); // Error
| ^~~~~~~~~~~~~~~~
<source>:7:17: note: candidate template ignored: substitution failure [with s = 0]: array size is not a constant expression
7 | static auto x() -> opts...[get_index<s>()] {}
| ^ ~~~~~~~~~
Metadata
Metadata
Assignees
Labels
c++26clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid