CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
200 lines
3.6 KiB
C++
200 lines
3.6 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s
|
|
|
|
namespace GH39811 {
|
|
|
|
template<int = 0> class C {};
|
|
|
|
C (a);
|
|
C (b) = C();
|
|
C (c) {};
|
|
C (((((d)))));
|
|
|
|
template<C (e)> class X;
|
|
template<C (...f)> class Y;
|
|
|
|
void test() {
|
|
C (g);
|
|
C (h) = C();
|
|
C (i) {};
|
|
(void)g;
|
|
(void)h;
|
|
(void)i;
|
|
}
|
|
|
|
C* (bad1); // expected-error {{cannot form pointer to deduced class template specialization type}}
|
|
C (*bad2); // expected-error {{cannot form pointer to deduced class template specialization type}}
|
|
|
|
}
|
|
|
|
namespace GH64347 {
|
|
|
|
template<typename X, typename Y> struct A { X x; Y y;};
|
|
void test() {
|
|
A(1, 2);
|
|
new A(1, 2);
|
|
}
|
|
|
|
template<A a>
|
|
void f() { (void)a; }
|
|
void k() {
|
|
// Test CTAD works for non-type template arguments.
|
|
f<A(0, 0)>();
|
|
}
|
|
|
|
} // namespace GH64347
|
|
|
|
namespace GH123591 {
|
|
|
|
|
|
template < typename... _Types >
|
|
struct variant {
|
|
template <int N = sizeof...(_Types)>
|
|
variant(_Types...);
|
|
};
|
|
|
|
template <class T>
|
|
using AstNode = variant<T, T, T>;
|
|
|
|
AstNode tree(42, 43, 44);
|
|
|
|
}
|
|
|
|
namespace GH123591_2 {
|
|
|
|
template <int>
|
|
using enable_if_t = char;
|
|
|
|
template < typename... Types >
|
|
struct variant {
|
|
template < enable_if_t<sizeof...(Types)>>
|
|
variant();
|
|
};
|
|
|
|
template <int>
|
|
using AstNode = variant<>;
|
|
// expected-note@-1 {{couldn't infer template argument ''}} \
|
|
// expected-note@-1 2{{implicit deduction guide declared as}} \
|
|
// expected-note@-1 {{candidate function not viable}}
|
|
|
|
|
|
AstNode tree; // expected-error {{no viable constructor or deduction guide}}
|
|
|
|
}
|
|
|
|
namespace GH127539 {
|
|
|
|
template <class...>
|
|
struct A {
|
|
template <class... ArgTs>
|
|
A(ArgTs...) {}
|
|
};
|
|
|
|
template <class... ArgTs>
|
|
A(ArgTs...) -> A<typename ArgTs::value_type...>;
|
|
|
|
template <class... Ts>
|
|
using AA = A<Ts..., Ts...>;
|
|
|
|
AA a{};
|
|
|
|
}
|
|
|
|
namespace GH129077 {
|
|
|
|
using size_t = decltype(sizeof(0));
|
|
|
|
struct index_type
|
|
{
|
|
size_t value = 0;
|
|
index_type() = default;
|
|
constexpr index_type(size_t i) noexcept : value(i) {}
|
|
};
|
|
|
|
template <index_type... Extents>
|
|
struct extents
|
|
{
|
|
constexpr extents(decltype(Extents)...) noexcept {}
|
|
};
|
|
|
|
template <class... Extents>
|
|
extents(Extents...) -> extents<(requires { Extents::value; } ? Extents{} : ~0ull)...>;
|
|
|
|
template <index_type... Index>
|
|
using index = extents<Index...>;
|
|
|
|
int main()
|
|
{
|
|
extents i{0,0};
|
|
auto j = extents<64,{}>({}, 42);
|
|
|
|
index k{0,0};
|
|
auto l = index<64,{}>({}, 42);
|
|
|
|
return 0;
|
|
}
|
|
|
|
}
|
|
|
|
namespace GH129620 {
|
|
|
|
template <class... Ts>
|
|
struct A {
|
|
constexpr A(Ts...) {}
|
|
};
|
|
|
|
template <class... Ts>
|
|
using Foo = A<Ts...>;
|
|
|
|
template <class T>
|
|
using Bar = Foo<T, T>;
|
|
|
|
Bar a{0, 0};
|
|
|
|
}
|
|
|
|
namespace GH129998 {
|
|
|
|
struct converible_to_one {
|
|
constexpr operator int() const noexcept { return 1; }
|
|
};
|
|
|
|
template <int... Extents>
|
|
struct class_template {
|
|
class_template() = default;
|
|
constexpr class_template(auto&&...) noexcept {}
|
|
};
|
|
|
|
template <class... Extents>
|
|
class_template(Extents...) -> class_template<(true ? 0 : +Extents{})...>;
|
|
|
|
template <int... Extents>
|
|
using alias_template = class_template<Extents...>;
|
|
|
|
alias_template var2{converible_to_one{}, 2};
|
|
|
|
}
|
|
|
|
namespace GH136624 {
|
|
// expected-note@+1 2{{no known conversion}}
|
|
template<typename U> struct A {
|
|
U t;
|
|
};
|
|
|
|
template<typename V> A(V) -> A<V>;
|
|
|
|
namespace foo {
|
|
template<class Y> using Alias = A<Y>;
|
|
}
|
|
|
|
// FIXME: This diagnostic is missing 'foo::Alias', as written.
|
|
foo::Alias t = 0;
|
|
// expected-error@-1 {{no viable conversion from 'int' to 'GH136624::A<int>' (aka 'A<int>')}}
|
|
} // namespace GH136624
|
|
|
|
namespace GH131342 {
|
|
template <class> constexpr int val{0};
|
|
template <class T, int> struct A { A(T) {} };
|
|
template <class T> using AA = A<T, val<T>>;
|
|
AA a{0};
|
|
} // namespace GH131342
|