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

2019-02-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Btw, I have changed the diagnostic wording... does this change make sense now? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58060/new/ https://reviews.llvm.org/D58060 ___ cfe-commits mailing list cfe-commits@list

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

2019-02-13 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58060#1396565 , @Anastasia wrote: > We had discussion related to this with John earlier. And I documented it in > this bug: https://bugs.llvm.org/show_bug.cgi?id=39674 I think we observed something similar to this downstream

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

2019-02-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 186699. Anastasia added a comment. Herald added a subscriber: javed.absar. - Changed the diagnostic for binding reference and combined with existing similar one. That affected more tests however. - Changed comment explaining address space behavior in the re

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

2019-02-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D58060#1396416 , @ebevhan wrote: > So static_cast permits conversions from AS1 to AS2 where that conversion is > implicitly allowed, and the new addrspace_cast would permit conversions from > AS1 to AS2 where it is explicitl

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

2019-02-13 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. So static_cast permits conversions from AS1 to AS2 where that conversion is implicitly allowed, and the new addrspace_cast would permit conversions from AS1 to AS2 where it is explicitly allowed. That seems like it fits in rather well with the idea in D57464

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

2019-02-12 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:1830 + "binding value %diff{of type $ to reference to type $|to reference}0,1 " + "changes address space">; def err_reference_bind_failed : Error< We say that references are

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

2019-02-11 Thread Anastasia Stulova via Phabricator via cfe-commits
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