Skip to content

Pack indexing expression is not being instantiated #121242

@Eczbek

Description

@Eczbek

Compiler Explorer: https://godbolt.org/z/TG4hMMPv3

template<int... x>
int y = x...[0];

int main() {
	y<0>;
}
<source>:2:5: error: cannot initialize a variable of type 'int' with an lvalue of type '<dependent type>'
    2 | int y = x...[0];
      |     ^   ~~~~~~~
<source>:5:2: warning: expression result unused [-Wunused-value]
    5 |         y<0>;
      |         ^~~~
1 warning and 1 error generated.
Compiler returned: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions