mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
6c716116df
the class becoming complete and its inline methods being parsed. This replaces the hack of using the "late parsed template" flag to track member functions with bodies we've not parsed yet; instead we now use the "will have body" flag, which carries the desired implication that the function declaration *is* a definition, and that we've just not parsed its body yet. llvm-svn: 310776
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
// RUN: %clang_cc1 -fcuda-is-device -fsyntax-only -verify %s
|
|
|
|
#include "Inputs/cuda.h"
|
|
|
|
// We don't allow destructors to be overloaded. Making this work would be a
|
|
// giant change to clang, and the use cases seem quite limited.
|
|
|
|
struct A {
|
|
~A() {} // expected-note {{previous definition is here}}
|
|
__device__ ~A() {} // expected-error {{destructor cannot be redeclared}}
|
|
};
|
|
|
|
struct B {
|
|
__host__ ~B() {} // expected-note {{previous definition is here}}
|
|
__host__ __device__ ~B() {} // expected-error {{destructor cannot be redeclared}}
|
|
};
|
|
|
|
struct C {
|
|
__host__ __device__ ~C() {} // expected-note {{previous definition is here}}
|
|
__host__ ~C() {} // expected-error {{destructor cannot be redeclared}}
|
|
};
|
|
|
|
struct D {
|
|
__device__ ~D() {} // expected-note {{previous definition is here}}
|
|
__host__ __device__ ~D() {} // expected-error {{destructor cannot be redeclared}}
|
|
};
|
|
|
|
struct E {
|
|
__host__ __device__ ~E() {} // expected-note {{previous definition is here}}
|
|
__device__ ~E() {} // expected-error {{destructor cannot be redeclared}}
|
|
};
|
|
|