[PATCH] D140996: [c++20] P1907R1: Support for generalized non-type template arguments of scalar type.
Shafik Yaghmour via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 24 15:27:11 PST 2023
shafik added inline comments.
================
Comment at: clang/test/CodeGenCXX/template-arguments.cpp:4
+
+template<typename T> CONSTEXPR T id(T v) { return v; }
+template<auto V> auto value = id(V);
----------------
I don't see any tests covering unions or enums.
================
Comment at: clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp:12
+using F1 = Float<1.0f>;
+using F1 = Float<2.0f / 2>;
----------------
I believe this is IFNDR the template-heads are functionally equivelent but not equivelent: https://eel.is/c++draft/temp.class#general-3
================
Comment at: clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp:56
+using CF = ComplexFloat<1.0f + 3.0fi>;
+using CF = ComplexFloat<3.0fi + 1.0f>;
----------------
Can we add an enum example e.g.:
```
enum E{ E1, E2};
template <E> struct SE {};
using IPE = SE<E1>;
using IPE = SE<E2>;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140996/new/
https://reviews.llvm.org/D140996
More information about the cfe-commits
mailing list