Skip to content

Default arguments followed by ellipsis not allowed in in-class function declarations #153445

@ckwastra

Description

@ckwastra

Test code (CE):

void f(int = {}...); // OK

struct S {
  void f(int = {}...); // Clang: error: unexpected end of default
                       // argument expression
  void g(int...);      // OK
};

void S::g(int = {}...) {} // OK

As shown above, this syntax compiles fine for function declarations outside the class, but not for in-class ones. This is inconsistent behavior.

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions