[PATCH] D79344: [cuda] Start diagnosing variables with bad target.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 17:24:00 PDT 2020


tra added a comment.

In D79344#2026180 <https://reviews.llvm.org/D79344#2026180>, @tra wrote:

> The problem is reproducible in upstream clang. Let's see if I can reduce it to something simpler.


Reduced it down to this -- compiles with clang w/o the patch, but fails with it.

  __attribute__((device)) double copysign(double, double);
  __attribute__((device)) double copysign(float, double);
  template <typename> struct a { static const bool b = true; };
  template <bool, class> struct c;
  template <class f> struct c<true, f> { typedef f g; };
  template <typename d, typename h>
  __attribute__((device)) typename c<a<h>::b, double>::g copysign(d, h) {
    double e = copysign(0, e);
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79344/new/

https://reviews.llvm.org/D79344





More information about the cfe-commits mailing list