[PATCH] D82657: [AST][RecoveryAST] Preserve the type by default for recovery expression.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 21 04:15:44 PDT 2020


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

New diagnostics are really good :-)



================
Comment at: clang/test/SemaCXX/abstract.cpp:282
 
-  void foo( C& c ) {}
+  void foo( C& c ) {} // expected-note {{candidate function not viable: expects an l-value for 1st argument}}
 
----------------
the new diagnostics are correct (nice!) but this is just a bug in the test:
see https://bugs.llvm.org/show_bug.cgi?id=12658 vs https://github.com/llvm/llvm-project/commit/ea03214a5e3413cf95e388f28e4d9b9eeb30210a

To keep the test simple, I'd consider changing C& to const C& here instead.


================
Comment at: clang/test/SemaCXX/type-convert-construct.cpp:9
   typedef int arr[];
-  int v3 = arr(); // expected-error {{array types cannot be value-initialized}}
+  int v3 = arr(); // expected-error {{array types cannot be value-initialized}} \
+                     expected-error {{cannot initialize a variable of type 'int' with an rvalue of type 'arr'}}
----------------
again, `arr v3 = arr();` is almost certainly intended


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82657/new/

https://reviews.llvm.org/D82657



More information about the cfe-commits mailing list