yaxunl added a comment. In D67509#1677722 <https://reviews.llvm.org/D67509#1677722>, @yaxunl wrote:
> In D67509#1677586 <https://reviews.llvm.org/D67509#1677586>, @yaxunl wrote: > > > In D67509#1677528 <https://reviews.llvm.org/D67509#1677528>, @tra wrote: > > > > > Looks like CUDA test-suite is triggering the assertion added by this > > > patch: > > > > > > http://lab.llvm.org:8011/builders/clang-cuda-build/builds/37301/steps/ninja%20build%20simple%20CUDA%20tests/logs/stdio > > > > > > I am taking a look. > > > I can reproduce similar asserts locally. It seems the assertion I added > `assert(!(HasD || HasH) || (NeedsD == HasD && NeedsH == HasH));` is not > always true. Since we do not have this assert before, I removed it. I will > study what causes it to assert and post it later. A reduced test case is struct A { A(); }; template <class T> struct B { T a; constexpr B() = default; }; B<A> x; `B<A>::B()` got implicit `__host__ __device__` attrs due to constexpr before entering Sema::inferCUDATargetForImplicitSpecialMember. In Sema::inferCUDATargetForImplicitSpecialMember, the inferred hostness of `B<A>::B()` is host since `A::A()` is host. This causes discrepancy between the inferred hostness and the existing hostness. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67509/new/ https://reviews.llvm.org/D67509 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits