aaron.ballman added a comment. I spotted some test coverage that I think we should add:
static_cast<auto>(whatever); reinterpret_cast<auto>(whatever); const_cast<auto>(whatever); dynamic_cast<auto>(whatever); (auto)whatever; I believe all of those should be rejected because of https://eel.is/c++draft/dcl.spec.auto#general-5.sentence-2. Are there changes needed for the AST printer for this new form of cast notation? I suppose one other question worth asking: if we're allowing `decltype(auto)(whatever)` as a Clang extension, should we be accepting `__typeof__(auto)(whatever)` as well? ================ Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2396 +def ext_decltype_auto_expr : ExtWarn< + "ISO C++23 DIS does not allow functional-style cast to 'decltype(auto)'">, + InGroup<DiagGroup<"decltype-auto-cast">>; ---------------- lichray wrote: > aaron.ballman wrote: > > Is there a reason this one should be `ExtWarn` instead of `Extension`? (I > > think we typically only issue this kind of diagnostic when `-pedantic` is > > specified.) > I took a look at other warnings. It seems that Clang believes that a portable > program can contain `Extension`s; if `ExtWarn` is issued, the program is not > likely to be portable. > > I asked GCC folks yesterday to see if they want to implement this extension, > and they are not interested. So I guess `ExtWarn` is suitable for now. Thanks! I think `ExtWarn` is fine based on that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits