Files
TheRock/compiler/amd-llvm/clang/test/Misc/diag-template-diffing-cxx98.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

82 lines
1.9 KiB
C++

// RUN: not %clang_cc1 -fsyntax-only %s -std=c++98 2>&1 | FileCheck %s
namespace PR14342 {
template<typename T, char a> struct X {};
X<int, 1> x = X<long, 257>();
// CHECK: error: no viable conversion from 'X<long, [...]>' to 'X<int, [...]>'
}
namespace PR15513 {
template <int x, int y = x+1>
class A {};
void foo(A<0> &M) {
// CHECK: no viable conversion from 'A<[...], (default) x + 1 aka 1>' to 'A<[...], 0>'
A<0, 0> N = M;
// CHECK: no viable conversion from 'A<0, [...]>' to 'A<1, [...]>'
A<1, 1> O = M;
}
}
namespace default_args {
template <int x, int y = 1+1, int z = 2>
class A {};
void foo(A<0> &M) {
// CHECK: no viable conversion from 'A<[...], (default) 1 + 1 aka 2, (default) 2>' to 'A<[...], 0, 0>'
A<0, 0, 0> N = M;
// CHECK: no viable conversion from 'A<[2 * ...], (default) 2>' to 'A<[2 * ...], 0>'
A<0, 2, 0> N2 = M;
}
}
namespace qualifiers {
template <class T>
void foo(void (func(T*)), T*) {}
template <class T>
class vector{};
void bar(const vector<int>*) {}
void test(volatile vector<int>* V) {
foo(bar, V);
}
// CHECK: candidate template ignored: deduced conflicting types for parameter 'T' ('const vector<...>' vs. 'volatile vector<...>')
}
namespace integers {
template <int x>
class wrapper{};
template <int x>
class foo {
public:
wrapper<x> make();
};
wrapper<1> w1 = foo<2>().make();
// CHECK: no viable conversion from 'wrapper<2>' to 'wrapper<1>'
wrapper<1> w2 = foo<-3>().make();
// CHECK: no viable conversion from 'wrapper<-3>' to 'wrapper<1>'
template <int x>
wrapper<x> make();
wrapper<1> w3 = make<4>();
// CHECK: no viable conversion from 'wrapper<4>' to 'wrapper<1>'
template <int x>
wrapper<-x> makeNegative();
wrapper<1> w4 = makeNegative<5>();
// CHECK: no viable conversion from 'wrapper<-5>' to 'wrapper<1>'
wrapper<1> w5 = makeNegative<-6>();
// CHECK: no viable conversion from 'wrapper<6>' to 'wrapper<1>'
}