Files
TheRock/compiler/amd-llvm/clang/test/Parser/cxx2a-constrained-template-param.cpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

71 lines
1.7 KiB
C++

// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
namespace type
{
template<typename T>
concept C1 = true;
template<C1 T, C1 U = int>
using A = T[10];
using a = A<int>;
namespace ns {
template<typename T, int a = 0>
concept C2 = true;
}
template<ns::C2 T1, ::type::ns::C2 T2> requires (sizeof(T1) <= sizeof(T2))
struct B { };
using b = B<int, int>;
template<ns::C2... T1>
struct C { };
using c1 = C<char, char, char>;
using c2 = C<char, char, char, char>;
}
namespace non_type
{
template<int v>
concept C1 = true;
template<C1 v, C1 u = 0> // expected-error{{expected a type}} // expected-note{{declared here}}
// expected-error@-1 2{{concept named in type constraint is not a type concept}}
// expected-error@-2 {{expected ',' or '>' in template-parameter-list}}
int A = v; // expected-error{{'v' does not refer to a value}}
}
namespace temp
{
template<typename>
struct test1 { }; // expected-note{{template is declared here}}
template<template<typename> typename T>
concept C1 = true;
template<C1 TT, C1 UU = test1> // expected-error{{use of class template 'test1' requires template arguments}}
// expected-error@-1 2{{concept named in type constraint is not a type concept}}
using A = TT<int>; // expected-error{{expected ';' after alias declaration}}
}
namespace PR67235 {
template <class T>
concept C = true;
template <auto D>
struct S {};
// Don't destroy annotation 'C' at the end of the lambda; else we'll run into a
// use-after-free bug while constructing the type constraint 'C' on 'Default'.
template <typename Ret, C Default = decltype([] { return Ret(); })>
void func() {}
template <typename Ret, C Default = S<[] { return Ret(); }>>
void func2() {}
}