Skip to content

[Clang] AttributedTypes are stripped from lambda function types #85120

@Sirraide

Description

@Sirraide

Consider

struct S {
  void g() const [[clang::annotate_type("foo", "bar", 1)]] {}
};

void f() {
  auto l = [] () [[clang::annotate_type("foo", "bar", 1)]] {};
}

AST dump prints 'void () const [[clang::annotate_type(...)]]':'void () const' for the type of S::g(), but void () const for the type of l, which is problematic if someone actually wants to use this information for something (#84983). We should fix this unless there’s a good reason why we’re desugaring the function type here.

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partylambdaC++11 lambda expressions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions