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
176 lines
3.6 KiB
C++
176 lines
3.6 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
typedef int INT;
|
|
|
|
class Foo {
|
|
Foo();
|
|
(Foo)(float) { }
|
|
explicit Foo(int); // expected-note {{previous declaration is here}}
|
|
Foo(const Foo&);
|
|
|
|
((Foo))(INT); // expected-error{{cannot be redeclared}}
|
|
|
|
Foo(Foo foo, int i = 17, int j = 42); // expected-error{{copy constructor must pass its first argument by reference}}
|
|
|
|
static Foo(short, short); // expected-error{{constructor cannot be declared 'static'}}
|
|
virtual Foo(double); // expected-error{{constructor cannot be declared 'virtual'}}
|
|
Foo(long) const; // expected-error{{'const' qualifier is not allowed on a constructor}}
|
|
|
|
int Foo(int, int); // expected-error{{constructor cannot have a return type}}
|
|
|
|
volatile Foo(float); // expected-error{{constructor cannot have a return type}}
|
|
};
|
|
|
|
Foo::Foo(const Foo&) { }
|
|
|
|
typedef struct {
|
|
int version;
|
|
} Anon;
|
|
extern const Anon anon;
|
|
extern "C" const Anon anon2;
|
|
|
|
// PR3188: The extern declaration complained about not having an appropriate
|
|
// constructor.
|
|
struct x;
|
|
extern x a;
|
|
|
|
// A similar case.
|
|
struct y {
|
|
y(int);
|
|
};
|
|
extern y b;
|
|
|
|
struct Length {
|
|
Length l() const { return *this; }
|
|
};
|
|
|
|
struct mmst_reg{
|
|
char mmst_reg[10];
|
|
};
|
|
|
|
// PR3948
|
|
namespace PR3948 {
|
|
// PR3948
|
|
class a {
|
|
public:
|
|
int b(int a());
|
|
};
|
|
int x();
|
|
void y() {
|
|
a z; z.b(x);
|
|
}
|
|
}
|
|
|
|
namespace A {
|
|
struct S {
|
|
S();
|
|
S(int);
|
|
void f1();
|
|
void f2();
|
|
operator int ();
|
|
~S();
|
|
};
|
|
}
|
|
|
|
A::S::S() {}
|
|
|
|
void A::S::f1() {}
|
|
|
|
struct S {};
|
|
|
|
A::S::S(int) {}
|
|
|
|
void A::S::f2() {}
|
|
|
|
A::S::operator int() { return 1; }
|
|
|
|
A::S::~S() {}
|
|
|
|
namespace PR38286 {
|
|
// FIXME: It'd be nice to give more consistent diagnostics for these cases
|
|
// (but they're all failing for somewhat different reasons...).
|
|
template<typename> struct A;
|
|
template<typename T> A<T>::A() {} // expected-error {{incomplete type 'A' named in nested name specifier}}
|
|
/*FIXME: needed to recover properly from previous error*/;
|
|
template<typename> struct B;
|
|
template<typename T> void B<T>::f() {} // expected-error {{out-of-line definition of 'f' from class 'PR38286::B<type-parameter-0-0>'}}
|
|
template<typename> struct C; // expected-note {{non-type declaration found}}
|
|
template<typename T> C<T>::~C() {} // expected-error {{identifier 'C' after '~' in destructor name does not name a type}}
|
|
}
|
|
|
|
namespace GH121706 {
|
|
|
|
struct A {
|
|
*&A(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct B {
|
|
*&&B(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct C {
|
|
*const C(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct D {
|
|
*const *D(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct E {
|
|
*E::*E(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct F {
|
|
*F::*const F(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct G {
|
|
****G(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct H {
|
|
**H(const H &); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct I {
|
|
*I(I &&); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct J {
|
|
*&(J)(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct K {
|
|
**&&(K)(); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct L {
|
|
*L(L&& other); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct M {
|
|
*M(M& other); // expected-error {{invalid constructor declaration}}
|
|
};
|
|
|
|
struct N {
|
|
int N(); // expected-error {{constructor cannot have a return type}}
|
|
};
|
|
|
|
struct O {
|
|
static O(); // expected-error {{constructor cannot be declared 'static'}}
|
|
};
|
|
|
|
struct P {
|
|
explicit P();
|
|
};
|
|
|
|
struct Q {
|
|
constexpr Q();
|
|
};
|
|
|
|
struct R {
|
|
R();
|
|
friend R::R();
|
|
};
|
|
|
|
}
|