[test] Make tests pass regardless of gnu++14/gnu++17 default
GCC from 11 onwards defaults to -std=gnu++17 for C++ source files. We want to do the same
(https://discourse.llvm.org/t/c-objc-switch-to-gnu-17-as-the-default-dialect/64360).
Split RUN lines, adjust `-verify`, or add `__cplusplus < 201703L` or `-Wno-dynamic-exception-spec`,
so that tests will pass regardless of gnu++14/gnu++17 default.
We have a desire to mark a test compatible with multiple language standards.
There are ongoing discussions how to add markers in the long term:
* https://discourse.llvm.org/t/iterating-lit-run-lines/62596
* https://discourse.llvm.org/t/lit-run-a-run-line-multiple-times-with-different-replacements/64932
As a workaround in the short term, add lit substitutions `%std_cxx98-`,
`%std_cxx11-14`, etc. They can be used for tests which work across multiple
language standards. If a range has `n` standards, run lit multiple times, with
`LIT_CLANG_STD_GROUP=0`, `LIT_CLANG_STD_GROUP=1`, etc to cover all `n` standards.
Reviewed By: #clang-language-wg, aaron.ballman
Differential Revision: https://reviews.llvm.org/D131464
2022-09-04 05:29:32 +00:00
|
|
|
// RUN: %clang_cc1 -triple i686-mingw32 %std_cxx11-14 -ast-dump %s | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -triple i686-mingw32 %std_cxx17- -ast-dump %s | FileCheck %s -check-prefix=CHECK-1Z
|
2021-10-24 00:44:17 +02:00
|
|
|
|
|
|
|
template<class T>
|
|
|
|
class P {
|
|
|
|
public:
|
|
|
|
P(T* t) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace foo {
|
|
|
|
class A { public: A(int = 0) {} };
|
|
|
|
enum B {};
|
|
|
|
typedef int C;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: VarDecl {{0x[0-9a-fA-F]+}} <line:[[@LINE+1]]:1, col:36> col:15 ImplicitConstrArray 'foo::A[2]'
|
|
|
|
static foo::A ImplicitConstrArray[2];
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
// CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::A *'
|
|
|
|
P<foo::A> p14 = new foo::A;
|
|
|
|
// CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::B *'
|
|
|
|
P<foo::B> p24 = new foo::B;
|
|
|
|
// CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::C *'
|
|
|
|
P<foo::C> pr4 = new foo::C;
|
|
|
|
}
|
|
|
|
|
|
|
|
foo::A getName() {
|
|
|
|
// CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:10, col:17> 'foo::A'
|
|
|
|
return foo::A();
|
|
|
|
}
|
|
|
|
|
|
|
|
void destruct(foo::A *a1, foo::A *a2, P<int> *p1) {
|
|
|
|
// CHECK: MemberExpr {{0x[0-9a-fA-F]+}} <col:3, col:8> '<bound member function type>' ->~A
|
|
|
|
a1->~A();
|
|
|
|
// CHECK: MemberExpr {{0x[0-9a-fA-F]+}} <col:3, col:16> '<bound member function type>' ->~A
|
|
|
|
a2->foo::A::~A();
|
|
|
|
// CHECK: MemberExpr {{0x[0-9a-fA-F]+}} <col:3, col:13> '<bound member function type>' ->~P
|
|
|
|
p1->~P<int>();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct D {
|
|
|
|
D(int);
|
|
|
|
~D();
|
|
|
|
};
|
|
|
|
|
|
|
|
void construct() {
|
|
|
|
using namespace foo;
|
|
|
|
A a = A(12);
|
[clang] Implement ElaboratedType sugaring for types written bare
Without this patch, clang will not wrap in an ElaboratedType node types written
without a keyword and nested name qualifier, which goes against the intent that
we should produce an AST which retains enough details to recover how things are
written.
The lack of this sugar is incompatible with the intent of the type printer
default policy, which is to print types as written, but to fall back and print
them fully qualified when they are desugared.
An ElaboratedTypeLoc without keyword / NNS uses no storage by itself, but still
requires pointer alignment due to pre-existing bug in the TypeLoc buffer
handling.
---
Troubleshooting list to deal with any breakage seen with this patch:
1) The most likely effect one would see by this patch is a change in how
a type is printed. The type printer will, by design and default,
print types as written. There are customization options there, but
not that many, and they mainly apply to how to print a type that we
somehow failed to track how it was written. This patch fixes a
problem where we failed to distinguish between a type
that was written without any elaborated-type qualifiers,
such as a 'struct'/'class' tags and name spacifiers such as 'std::',
and one that has been stripped of any 'metadata' that identifies such,
the so called canonical types.
Example:
```
namespace foo {
struct A {};
A a;
};
```
If one were to print the type of `foo::a`, prior to this patch, this
would result in `foo::A`. This is how the type printer would have,
by default, printed the canonical type of A as well.
As soon as you add any name qualifiers to A, the type printer would
suddenly start accurately printing the type as written. This patch
will make it print it accurately even when written without
qualifiers, so we will just print `A` for the initial example, as
the user did not really write that `foo::` namespace qualifier.
2) This patch could expose a bug in some AST matcher. Matching types
is harder to get right when there is sugar involved. For example,
if you want to match a type against being a pointer to some type A,
then you have to account for getting a type that is sugar for a
pointer to A, or being a pointer to sugar to A, or both! Usually
you would get the second part wrong, and this would work for a
very simple test where you don't use any name qualifiers, but
you would discover is broken when you do. The usual fix is to
either use the matcher which strips sugar, which is annoying
to use as for example if you match an N level pointer, you have
to put N+1 such matchers in there, beginning to end and between
all those levels. But in a lot of cases, if the property you want
to match is present in the canonical type, it's easier and faster
to just match on that... This goes with what is said in 1), if
you want to match against the name of a type, and you want
the name string to be something stable, perhaps matching on
the name of the canonical type is the better choice.
3) This patch could expose a bug in how you get the source range of some
TypeLoc. For some reason, a lot of code is using getLocalSourceRange(),
which only looks at the given TypeLoc node. This patch introduces a new,
and more common TypeLoc node which contains no source locations on itself.
This is not an inovation here, and some other, more rare TypeLoc nodes could
also have this property, but if you use getLocalSourceRange on them, it's not
going to return any valid locations, because it doesn't have any. The right fix
here is to always use getSourceRange() or getBeginLoc/getEndLoc which will dive
into the inner TypeLoc to get the source range if it doesn't find it on the
top level one. You can use getLocalSourceRange if you are really into
micro-optimizations and you have some outside knowledge that the TypeLocs you are
dealing with will always include some source location.
4) Exposed a bug somewhere in the use of the normal clang type class API, where you
have some type, you want to see if that type is some particular kind, you try a
`dyn_cast` such as `dyn_cast<TypedefType>` and that fails because now you have an
ElaboratedType which has a TypeDefType inside of it, which is what you wanted to match.
Again, like 2), this would usually have been tested poorly with some simple tests with
no qualifications, and would have been broken had there been any other kind of type sugar,
be it an ElaboratedType or a TemplateSpecializationType or a SubstTemplateParmType.
The usual fix here is to use `getAs` instead of `dyn_cast`, which will look deeper
into the type. Or use `getAsAdjusted` when dealing with TypeLocs.
For some reason the API is inconsistent there and on TypeLocs getAs behaves like a dyn_cast.
5) It could be a bug in this patch perhaps.
Let me know if you need any help!
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D112374
2021-10-11 18:15:36 +02:00
|
|
|
// CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:9, col:13> 'A':'foo::A' 'void (int){{( __attribute__\(\(thiscall\)\))?}}'
|
2021-10-24 00:44:17 +02:00
|
|
|
D d = D(12);
|
2023-10-26 19:28:28 +01:00
|
|
|
// CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:9, col:13> 'D' 'void (int){{( __attribute__\(\(thiscall\)\))?}}'
|
2021-10-24 00:44:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace PR38987 {
|
|
|
|
struct A { A(); };
|
|
|
|
template <class T> void f() { T{}; }
|
|
|
|
template void f<A>();
|
2023-10-26 19:28:28 +01:00
|
|
|
// CHECK: CXXTemporaryObjectExpr {{.*}} <col:31, col:33> 'PR38987::A'
|
2021-10-24 00:44:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void abort() __attribute__((noreturn));
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
typedef decltype(sizeof(int)) size_t;
|
|
|
|
|
|
|
|
template <typename E> struct initializer_list {
|
|
|
|
const E *p;
|
|
|
|
size_t n;
|
|
|
|
initializer_list(const E *p, size_t n) : p(p), n(n) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename F, typename S> struct pair {
|
|
|
|
F f;
|
|
|
|
S s;
|
|
|
|
pair(const F &f, const S &s) : f(f), s(s) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct string {
|
|
|
|
const char *str;
|
|
|
|
string() { abort(); }
|
|
|
|
string(const char *S) : str(S) {}
|
|
|
|
~string() { abort(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename K, typename V>
|
|
|
|
struct map {
|
|
|
|
using T = pair<K, V>;
|
|
|
|
map(initializer_list<T> i, const string &s = string()) {}
|
|
|
|
~map() { abort(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace std
|
|
|
|
|
|
|
|
// CHECK: NamespaceDecl {{.*}} attributed_decl
|
|
|
|
namespace attributed_decl {
|
|
|
|
void f() {
|
|
|
|
// CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:28>
|
|
|
|
[[maybe_unused]] int i1;
|
|
|
|
// CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:35>
|
|
|
|
__attribute__((unused)) int i2;
|
|
|
|
// CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:35>
|
|
|
|
int __attribute__((unused)) i3;
|
|
|
|
// CHECK: DeclStmt {{.*}} <<built-in>:{{.*}}, {{.*}}:[[@LINE+1]]:40>
|
|
|
|
__declspec(dllexport) extern int i4;
|
|
|
|
// CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:40>
|
|
|
|
extern int __declspec(dllexport) i5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-1Z: NamespaceDecl {{.*}} attributed_case
|
|
|
|
namespace attributed_case {
|
|
|
|
void f(int n) {
|
|
|
|
switch (n) {
|
|
|
|
case 0:
|
|
|
|
n--;
|
|
|
|
// CHECK: AttributedStmt {{.*}} <line:[[@LINE+2]]:5, line:[[@LINE+4]]:35>
|
|
|
|
// CHECK: FallThroughAttr {{.*}} <line:[[@LINE+1]]:20>
|
|
|
|
__attribute__((fallthrough))
|
|
|
|
// CHECK: FallThroughAttr {{.*}} <line:[[@LINE+1]]:22>
|
|
|
|
__attribute__((fallthrough));
|
|
|
|
case 1:
|
|
|
|
n++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace attributed_case
|
|
|
|
|
|
|
|
// CHECK: NamespaceDecl {{.*}} attributed_stmt
|
|
|
|
namespace attributed_stmt {
|
|
|
|
// In DO_PRAGMA and _Pragma cases, `LoopHintAttr` comes from <scratch space>
|
|
|
|
// file.
|
|
|
|
|
|
|
|
#define DO_PRAGMA(x) _Pragma (#x)
|
|
|
|
|
|
|
|
void f() {
|
|
|
|
// CHECK: AttributedStmt {{.*}} <line:[[@LINE-3]]:24, line:[[@LINE+2]]:33>
|
|
|
|
DO_PRAGMA (unroll(2))
|
|
|
|
for (int i = 0; i < 10; ++i);
|
|
|
|
|
|
|
|
// CHECK: AttributedStmt {{.*}} <line:[[@LINE+2]]:5, line:[[@LINE+3]]:33>
|
|
|
|
// CHECK: LoopHintAttr {{.*}} <line:[[@LINE+1]]:13, col:22>
|
|
|
|
#pragma unroll(2)
|
|
|
|
for (int i = 0; i < 10; ++i);
|
|
|
|
|
|
|
|
// CHECK: AttributedStmt {{.*}} <line:[[@LINE+2]]:5, line:[[@LINE+5]]:33>
|
|
|
|
// CHECK: LoopHintAttr {{.*}} <line:[[@LINE+1]]:19, col:41>
|
|
|
|
#pragma clang loop vectorize(enable)
|
|
|
|
// CHECK: LoopHintAttr {{.*}} <line:[[@LINE+1]]:19, col:42>
|
|
|
|
#pragma clang loop interleave(enable)
|
|
|
|
for (int i = 0; i < 10; ++i);
|
|
|
|
|
|
|
|
// CHECK: AttributedStmt {{.*}} <line:[[@LINE+1]]:5, line:[[@LINE+2]]:33>
|
|
|
|
_Pragma("unroll(2)")
|
|
|
|
for (int i = 0; i < 10; ++i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if __cplusplus >= 201703L
|
|
|
|
// CHECK-1Z: FunctionDecl {{.*}} construct_with_init_list
|
|
|
|
std::map<int, int> construct_with_init_list() {
|
|
|
|
// CHECK-1Z-NEXT: CompoundStmt
|
|
|
|
// CHECK-1Z-NEXT: ReturnStmt {{.*}} <line:[[@LINE+5]]:3, col:35
|
|
|
|
// CHECK-1Z-NEXT: ExprWithCleanups {{.*}} <col:10, col:35
|
|
|
|
// CHECK-1Z-NEXT: CXXBindTemporaryExpr {{.*}} <col:10, col:35
|
|
|
|
// CHECK-1Z-NEXT: CXXTemporaryObjectExpr {{.*}} <col:10, col:35
|
|
|
|
// CHECK-1Z-NEXT: CXXStdInitializerListExpr {{.*}} <col:28, col:35
|
|
|
|
return std::map<int, int>{{0, 0}};
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-1Z: NamespaceDecl {{.*}} in_class_init
|
|
|
|
namespace in_class_init {
|
|
|
|
struct A {};
|
|
|
|
|
|
|
|
// CHECK-1Z: CXXRecordDecl {{.*}} struct B definition
|
|
|
|
struct B {
|
[clang] Implement ElaboratedType sugaring for types written bare
Without this patch, clang will not wrap in an ElaboratedType node types written
without a keyword and nested name qualifier, which goes against the intent that
we should produce an AST which retains enough details to recover how things are
written.
The lack of this sugar is incompatible with the intent of the type printer
default policy, which is to print types as written, but to fall back and print
them fully qualified when they are desugared.
An ElaboratedTypeLoc without keyword / NNS uses no storage by itself, but still
requires pointer alignment due to pre-existing bug in the TypeLoc buffer
handling.
---
Troubleshooting list to deal with any breakage seen with this patch:
1) The most likely effect one would see by this patch is a change in how
a type is printed. The type printer will, by design and default,
print types as written. There are customization options there, but
not that many, and they mainly apply to how to print a type that we
somehow failed to track how it was written. This patch fixes a
problem where we failed to distinguish between a type
that was written without any elaborated-type qualifiers,
such as a 'struct'/'class' tags and name spacifiers such as 'std::',
and one that has been stripped of any 'metadata' that identifies such,
the so called canonical types.
Example:
```
namespace foo {
struct A {};
A a;
};
```
If one were to print the type of `foo::a`, prior to this patch, this
would result in `foo::A`. This is how the type printer would have,
by default, printed the canonical type of A as well.
As soon as you add any name qualifiers to A, the type printer would
suddenly start accurately printing the type as written. This patch
will make it print it accurately even when written without
qualifiers, so we will just print `A` for the initial example, as
the user did not really write that `foo::` namespace qualifier.
2) This patch could expose a bug in some AST matcher. Matching types
is harder to get right when there is sugar involved. For example,
if you want to match a type against being a pointer to some type A,
then you have to account for getting a type that is sugar for a
pointer to A, or being a pointer to sugar to A, or both! Usually
you would get the second part wrong, and this would work for a
very simple test where you don't use any name qualifiers, but
you would discover is broken when you do. The usual fix is to
either use the matcher which strips sugar, which is annoying
to use as for example if you match an N level pointer, you have
to put N+1 such matchers in there, beginning to end and between
all those levels. But in a lot of cases, if the property you want
to match is present in the canonical type, it's easier and faster
to just match on that... This goes with what is said in 1), if
you want to match against the name of a type, and you want
the name string to be something stable, perhaps matching on
the name of the canonical type is the better choice.
3) This patch could expose a bug in how you get the source range of some
TypeLoc. For some reason, a lot of code is using getLocalSourceRange(),
which only looks at the given TypeLoc node. This patch introduces a new,
and more common TypeLoc node which contains no source locations on itself.
This is not an inovation here, and some other, more rare TypeLoc nodes could
also have this property, but if you use getLocalSourceRange on them, it's not
going to return any valid locations, because it doesn't have any. The right fix
here is to always use getSourceRange() or getBeginLoc/getEndLoc which will dive
into the inner TypeLoc to get the source range if it doesn't find it on the
top level one. You can use getLocalSourceRange if you are really into
micro-optimizations and you have some outside knowledge that the TypeLocs you are
dealing with will always include some source location.
4) Exposed a bug somewhere in the use of the normal clang type class API, where you
have some type, you want to see if that type is some particular kind, you try a
`dyn_cast` such as `dyn_cast<TypedefType>` and that fails because now you have an
ElaboratedType which has a TypeDefType inside of it, which is what you wanted to match.
Again, like 2), this would usually have been tested poorly with some simple tests with
no qualifications, and would have been broken had there been any other kind of type sugar,
be it an ElaboratedType or a TemplateSpecializationType or a SubstTemplateParmType.
The usual fix here is to use `getAs` instead of `dyn_cast`, which will look deeper
into the type. Or use `getAsAdjusted` when dealing with TypeLocs.
For some reason the API is inconsistent there and on TypeLocs getAs behaves like a dyn_cast.
5) It could be a bug in this patch perhaps.
Let me know if you need any help!
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D112374
2021-10-11 18:15:36 +02:00
|
|
|
// CHECK-1Z: FieldDecl {{.*}} a 'A':'in_class_init::A'
|
2021-10-24 00:44:17 +02:00
|
|
|
// CHECK-1Z-NEXT: InitListExpr {{.*}} <col:11, col:12
|
|
|
|
A a = {};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-1Z: NamespaceDecl {{.*}} delegating_constructor_init
|
|
|
|
namespace delegating_constructor_init {
|
|
|
|
struct A {};
|
|
|
|
|
|
|
|
struct B : A {
|
|
|
|
A a;
|
|
|
|
B(A a) : a(a) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
// CHECK-1Z: CXXRecordDecl {{.*}} struct C definition
|
|
|
|
struct C : B {
|
|
|
|
// CHECK-1Z: CXXConstructorDecl {{.*}} C
|
[clang] Implement ElaboratedType sugaring for types written bare
Without this patch, clang will not wrap in an ElaboratedType node types written
without a keyword and nested name qualifier, which goes against the intent that
we should produce an AST which retains enough details to recover how things are
written.
The lack of this sugar is incompatible with the intent of the type printer
default policy, which is to print types as written, but to fall back and print
them fully qualified when they are desugared.
An ElaboratedTypeLoc without keyword / NNS uses no storage by itself, but still
requires pointer alignment due to pre-existing bug in the TypeLoc buffer
handling.
---
Troubleshooting list to deal with any breakage seen with this patch:
1) The most likely effect one would see by this patch is a change in how
a type is printed. The type printer will, by design and default,
print types as written. There are customization options there, but
not that many, and they mainly apply to how to print a type that we
somehow failed to track how it was written. This patch fixes a
problem where we failed to distinguish between a type
that was written without any elaborated-type qualifiers,
such as a 'struct'/'class' tags and name spacifiers such as 'std::',
and one that has been stripped of any 'metadata' that identifies such,
the so called canonical types.
Example:
```
namespace foo {
struct A {};
A a;
};
```
If one were to print the type of `foo::a`, prior to this patch, this
would result in `foo::A`. This is how the type printer would have,
by default, printed the canonical type of A as well.
As soon as you add any name qualifiers to A, the type printer would
suddenly start accurately printing the type as written. This patch
will make it print it accurately even when written without
qualifiers, so we will just print `A` for the initial example, as
the user did not really write that `foo::` namespace qualifier.
2) This patch could expose a bug in some AST matcher. Matching types
is harder to get right when there is sugar involved. For example,
if you want to match a type against being a pointer to some type A,
then you have to account for getting a type that is sugar for a
pointer to A, or being a pointer to sugar to A, or both! Usually
you would get the second part wrong, and this would work for a
very simple test where you don't use any name qualifiers, but
you would discover is broken when you do. The usual fix is to
either use the matcher which strips sugar, which is annoying
to use as for example if you match an N level pointer, you have
to put N+1 such matchers in there, beginning to end and between
all those levels. But in a lot of cases, if the property you want
to match is present in the canonical type, it's easier and faster
to just match on that... This goes with what is said in 1), if
you want to match against the name of a type, and you want
the name string to be something stable, perhaps matching on
the name of the canonical type is the better choice.
3) This patch could expose a bug in how you get the source range of some
TypeLoc. For some reason, a lot of code is using getLocalSourceRange(),
which only looks at the given TypeLoc node. This patch introduces a new,
and more common TypeLoc node which contains no source locations on itself.
This is not an inovation here, and some other, more rare TypeLoc nodes could
also have this property, but if you use getLocalSourceRange on them, it's not
going to return any valid locations, because it doesn't have any. The right fix
here is to always use getSourceRange() or getBeginLoc/getEndLoc which will dive
into the inner TypeLoc to get the source range if it doesn't find it on the
top level one. You can use getLocalSourceRange if you are really into
micro-optimizations and you have some outside knowledge that the TypeLocs you are
dealing with will always include some source location.
4) Exposed a bug somewhere in the use of the normal clang type class API, where you
have some type, you want to see if that type is some particular kind, you try a
`dyn_cast` such as `dyn_cast<TypedefType>` and that fails because now you have an
ElaboratedType which has a TypeDefType inside of it, which is what you wanted to match.
Again, like 2), this would usually have been tested poorly with some simple tests with
no qualifications, and would have been broken had there been any other kind of type sugar,
be it an ElaboratedType or a TemplateSpecializationType or a SubstTemplateParmType.
The usual fix here is to use `getAs` instead of `dyn_cast`, which will look deeper
into the type. Or use `getAsAdjusted` when dealing with TypeLocs.
For some reason the API is inconsistent there and on TypeLocs getAs behaves like a dyn_cast.
5) It could be a bug in this patch perhaps.
Let me know if you need any help!
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D112374
2021-10-11 18:15:36 +02:00
|
|
|
// CHECK-1Z-NEXT: CXXCtorInitializer 'B':'delegating_constructor_init::B'
|
2021-10-24 00:44:17 +02:00
|
|
|
// CHECK-1Z-NEXT: CXXConstructExpr {{.*}} <col:11, col:15
|
|
|
|
// CHECK-1Z-NEXT: InitListExpr {{.*}} <col:13, col:14
|
|
|
|
C() : B({}) {};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-1Z: NamespaceDecl {{.*}} new_init
|
|
|
|
namespace new_init {
|
|
|
|
void A() {
|
|
|
|
// CHECK-1Z: CXXNewExpr {{.*}} <line:[[@LINE+2]]:5, col:14
|
|
|
|
// CHECK-1Z-NEXT: InitListExpr {{.*}} <col:12, col:14
|
|
|
|
new int{0};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|