[PATCH] D74116: [Sema][C++] Strawman patch to propagate conversion type in order to specialize the diagnostics

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 6 03:36:55 PST 2020


Anastasia created this revision.
Anastasia added a reviewer: rjmccall.
Herald added a subscriber: ebevhan.
Anastasia edited the summary of this revision.

Currently in C++ we don't set/propagate what type of implicit conversions occurs on assignments/initializations/params/etc. Therefore the diagnostic provided is more generic than in C mode. This patch attempt to propagate the conversion kind through layers of C++ semantic checks. It is currently only used for address spaces conversion of nested pointers (from https://reviews.llvm.org/D73360). Setting this for other conversions would be quite a lot of work and I am not sure I feel confident to get it right. We could potentially gradually modify it as we go along. Although this is not an actively modified code base at the moment so not sure whether it will happen and when.

Feedback welcome!


https://reviews.llvm.org/D74116

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaExceptionSpec.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaTemplate.cpp
  clang/lib/Sema/SemaTemplateDeduction.cpp
  clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74116.242851.patch
Type: text/x-patch
Size: 35167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200206/cc9f3b1f/attachment-0001.bin>


More information about the cfe-commits mailing list