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
53 lines
2.4 KiB
C++
53 lines
2.4 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// Check that "::new" and "::delete" in member initializer list are diagnosed
|
|
// correctly and don't lead to infinite loop on parsing.
|
|
|
|
// Error: X() (initializer on non-constructor), "::new" is skipped.
|
|
void f1() : X() ::new{}; // expected-error{{only constructors take base initializers}}
|
|
|
|
// Errors: first "::delete" and initializer on non-constructor, others skipped.
|
|
void f2() : ::delete, ::new, X() ::new ::delete{} // expected-error{{expected class member or base class name}}
|
|
// expected-error@-1{{only constructors take base initializers}}
|
|
|
|
// Errors: the '::' token, "::delete" and initializer on non-constructor, others skipped.
|
|
void f3() : ::, ::delete X(), ::new {}; // expected-error2{{expected class member or base class name}}
|
|
// expected-error@-1{{only constructors take base initializers}}
|
|
|
|
template <class T>
|
|
struct Base1 {
|
|
T x1;
|
|
Base1(T a1) : x1(a1) {}
|
|
};
|
|
|
|
template <class T>
|
|
struct Base2 {
|
|
T x2;
|
|
Base2(T a2) : x2(a2) {}
|
|
};
|
|
|
|
struct S : public Base1<int>, public Base2<float> {
|
|
int x;
|
|
|
|
// 1-st initializer is correct (just missing ','), 2-nd incorrect, skip other.
|
|
S() : ::Base1<int>(0) ::new, ::Base2<float>(1.0) ::delete x(2) {} // expected-error{{expected class member or base class name}}
|
|
// expected-error@-1{{missing ',' between base or member initializers}}
|
|
|
|
// 1-st and 2-nd are correct, errors: '::' and "::new", others skipped.
|
|
S(int a) : Base1<int>(a), ::Base2<float>(1.0), ::, // expected-error{{expected class member or base class name}}
|
|
::new, ! ::delete, ::Base2<() x(3) {} // expected-error{{expected class member or base class name}}
|
|
|
|
// All initializers are correct, nothing to skip, diagnose 2 missing commas.
|
|
S(const S &) : Base1<int>(0) ::Base2<float>(1.0) x(2) {} // expected-error2{{missing ',' between base or member initializers}}
|
|
};
|
|
|
|
namespace GH113722 {
|
|
struct S {
|
|
void m(int x = 0; // expected-error {{unexpected end of default argument expression}} \
|
|
expected-note {{to match this '('}}
|
|
#pragma unused(x) // expected-error {{expected ')'}} \
|
|
expected-error {{expected ';' at end of declaration list}}
|
|
} // expected-error {{expected ';' after struct}}
|
|
};
|
|
} // expected-error {{extraneous closing brace ('}')}}
|