[PATCH] D67509: [CUDA][HIP] Diagnose defaulted constructor only if it is used

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 12:20:52 PDT 2019


tra added a comment.

Example of the actual error produced by clang: https://godbolt.org/z/Dl1FfC

Ugh. Another corner case of the way we're dealing with implicit `__host__ __device__` functions. :-(
LGTM for postponing the error until actual use.



================
Comment at: test/SemaCUDA/default-ctor.cu:1
+// RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only -fcuda-is-device -verify %s
+
----------------
It would be good to add host-side compilation, too. 


================
Comment at: test/SemaCUDA/default-ctor.cu:4
+#define __host__ __attribute__((host))
+#define __device__ __attribute__((device))
+
----------------
Use `#include "Inputs/cuda.h"` instead.


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

https://reviews.llvm.org/D67509





More information about the cfe-commits mailing list