[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. fixed by 4921ecfc8194c11ec7c659ad1de11da6e8307361 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104505/new/ https://reviews.llvm.org/D104505

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D104505#2840239 , @ro wrote: > This patch broke the Solaris/sparcv9 > and Solaris/amd64 > buildbots: > > >

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-25 Thread Rainer Orth via Phabricator via cfe-commits
ro added a comment. This patch broke the Solaris/sparcv9 and Solaris/amd64 buildbots:

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-23 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rG82e03e494f98: [HIP] Defer operator overloading errors (authored by yaxunl). Herald added a project: clang.

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/deferred-oeverload.cu:55 callee3(); // dev-error {{no matching function for call to 'callee3'}} callee4(); // com-error {{no matching function for call to 'callee4'}} + S

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-23 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added inline comments. This revision is now accepted and ready to land. Comment at: clang/test/SemaCUDA/deferred-oeverload.cu:55 callee3(); // dev-error {{no matching function for call to 'callee3'}} callee4(); // com-error {{no matching

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/SemaCUDA/deferred-oeverload.cu:55 callee3(); // dev-error {{no matching function for call to 'callee3'}} callee4(); // com-error {{no matching function for call to 'callee4'}} + S s; tra wrote: > If we're

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-22 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D104505#2833943 , @yaxunl wrote: > We don't defer such diags by default. We only defer them under option > -fgpu-defer-diags, which users have to specify explicitly. Thank you for pointing this out. I've missed that all the

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D104505#2833746 , @tra wrote: > In D104505#2833271 , @yaxunl wrote: > >> Such host/device overloading resolution induced issue is not limited to >> device functions calling host

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-22 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D104505#2833271 , @yaxunl wrote: > Such host/device overloading resolution induced issue is not limited to > device functions calling host functions. It does not change the fact that the code in the test above is invalid,

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D104505#2831811 , @tra wrote: > In D104505#2831644 , @yaxunl wrote: > >> However, this does cause source level incompatibilities, i.e. CUDA code that >> passes nvcc does not pass

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-21 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D104505#2831644 , @yaxunl wrote: > However, this does cause source level incompatibilities, i.e. CUDA code that > passes nvcc does not pass clang. This patch somehow addresses that without > compromising clang's more

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D104505#2831555 , @tra wrote: > In NVCC's compilation only device-side compilation is aware of "semantics' of > `__host__`/`__device__` attributes. HOST-side compilation is not aware of GPU > existence. `cudafe++` massages

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D104505#2830996 , @tra wrote: > I don't think we want to do this. > > struct S { > S& operator <<(int x); > }; > > __device__ void foo() { > S s; > s<<1; > } > > :7:6: error: invalid operands

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-21 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. I don't think we want to do this. struct S { S& operator <<(int x); }; __device__ void foo() { S s; s<<1; } :7:6: error: invalid operands to binary expression ('S' and 'int') s<<1; ~^ ~ :2:8: note: candidate function not

[PATCH] D104505: [HIP] Defer operator overloading errors

2021-06-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall, rsmith. yaxunl requested review of this revision. nvcc does not diagnose overloading resolution diagnostics if it happens in functions not emitted, e.g., if a device function calls a host function, it is not diagnosed in host