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
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
// RUN: %clang_cc1 -pedantic -std=c++1y -include %s -include %s -verify %s
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -o %t.1 %s
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.1 -emit-pch -o %t.2 %s
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.2 -verify %s
|
|
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -emit-pch -fpch-instantiate-templates -o %t.1 %s
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.1 -emit-pch -fpch-instantiate-templates -o %t.2 %s
|
|
// RUN: %clang_cc1 -pedantic -std=c++1y -include-pch %t.2 -verify %s
|
|
|
|
#ifndef HEADER_1
|
|
#define HEADER_1
|
|
|
|
struct A {
|
|
int x;
|
|
int y = 3;
|
|
int z = x + y;
|
|
};
|
|
template<typename T> constexpr A make() { return A {}; }
|
|
template<typename T> constexpr A make(T t) { return A { t }; }
|
|
|
|
struct B {
|
|
int z1, z2 = z1;
|
|
constexpr B(int k) : z1(k) {}
|
|
};
|
|
|
|
template<typename T> struct C {
|
|
constexpr C() {}
|
|
T c = T();
|
|
struct U {};
|
|
};
|
|
// Instantiate C<int> but not the default initializer.
|
|
C<int>::U ciu;
|
|
|
|
#elif !defined(HEADER_2)
|
|
#define HEADER_2
|
|
|
|
// Instantiate the default initializer now, should create an update record.
|
|
C<int> ci;
|
|
|
|
#else
|
|
|
|
static_assert(A{}.z == 3, "");
|
|
static_assert(A{1}.z == 4, "");
|
|
static_assert(A{.y = 5}.z == 5, ""); // expected-warning {{C++20}}
|
|
static_assert(A{3, .y = 1}.z == 4, ""); // expected-warning {{C99}} expected-note {{here}}
|
|
static_assert(make<int>().z == 3, "");
|
|
static_assert(make<int>(12).z == 15, "");
|
|
static_assert(C<int>().c == 0, "");
|
|
|
|
#endif
|