[PATCH] D68753: [CUDA][HIP} Add a test for constexpr default ctor

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 12:28:08 PDT 2019


yaxunl marked an inline comment as done.
yaxunl added inline comments.


================
Comment at: test/SemaCUDA/constexpr-ctor.cu:14-27
+template <class T> struct B {
+  T a;
+  constexpr B() = default;
+};
+
+template <class T> struct C {
+  T a;
----------------
tra wrote:
> Do we really need three identical templates? If they are needed to let compiler emit multiple diagnostics, perhaps we could just add another template parameter so we can get different instantiations.
the error is emitted on the default ctor of the template. If we do not use different templates, all errors are emitted on the same line, we cannot make sure some instantiations do not cause error and some instantiations should cause error.

Adding template parameter will not help, because the error will still be emitted to the same line.


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

https://reviews.llvm.org/D68753





More information about the cfe-commits mailing list