void foo() {
auto x = [] [[noreturn]] (int msg) { throw; }; // accepted in wrong place.
auto y = [](int msg) [[noreturn]] { throw; }; // not accepted in the right place
auto z = [](int) [[clang::annotate_type("foo")]] {};
}
https://godbolt.org/z/sqnWo4v67
The attributes should be accepted after the parameters in the lambda declarator.
https://timsong-cpp.github.io/cppwp/n4868/expr.prim.lambda#nt:lambda-declarator