[PATCH] D85390: [Clang] Add note for bad conversion error when expression is of forward-declared type

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 10:35:03 PDT 2020


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

Looks great, thanks! I put a suggestion for different wording of the note, but I'll leave it up to you to decide.



================
Comment at: clang/test/SemaCXX/pointer-forward-declared-class-conversion.cpp:4
+class A1 {};
+class B1; // expected-note{{forward declaration of class here, conversion will be valid if the class 'B1' is derived from 'A1'}}
+B1 *b1;
----------------
Thanks, this is a much better message!

Instead of "forward declaration of class" it would be good to use the class name there, for example:

"'B1' is not defined, but forward declared here; conversion would be valid if it's derived from 'A1'"

Or something like that. Finding the right words is hard :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85390



More information about the cfe-commits mailing list