aaron.ballman added inline comments.

================
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">>;
----------------
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.)


================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1035
+      // the typename-specifier in a function-style cast expression may
+      // be 'auto' since C++2b
       Diag(Tok.getLocation(),
----------------



================
Comment at: 
clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.auto.deduct/p2.cpp:4
+// p2.3 allows only T = auto in T(x).
+// As a Clang extension, we also allow T = decltype(auto) to match p2.2 (new 
T(x)).
+
----------------
lichray wrote:
> rsmith wrote:
> > We should produce an `ExtWarn` for this case.
> Fixed. Now silenced in this file and produced somewhere else.
> We should produce an ExtWarn for this case.

Can you help me understand our rule for when to use `ExtWarn` vs `Extension` 
for this? I was under the impression we used `Extension` for this sort of 
thing, and only used `ExtWarn` in the cases where the use of the extension is 
wrong and the warning should be on by default.


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

Reply via email to