[PATCH] D58060: Fix diagnostic for addr spaces in static_cast

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 09:05:25 PST 2019


Anastasia created this revision.
Anastasia added a reviewer: rjmccall.
Herald added a subscriber: ebevhan.

When we diagnose `static_cast` we should prevent accidental address space conversions unless the conversion is safe (i.e. converting to an address space that is a super set is safe!).

Some more details are explained in this RFC: http://lists.llvm.org/pipermail/cfe-dev/2018-December/060546.html

This patch also changes diagnostic to use Qualifiers print method.


https://reviews.llvm.org/D58060

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaInit.cpp
  test/SemaCXX/err_reference_bind_drops_quals.cpp
  test/SemaOpenCLCXX/address-space-castoperators.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58060.186272.patch
Type: text/x-patch
Size: 7405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190211/82c0c16b/attachment-0001.bin>


More information about the cfe-commits mailing list