blob: c47239ed0f32cef7f75af2e2f595c670a7ae3846 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -ast-dump %s | FileCheck %s
struct Node {
long val;
};
template <bool>
void CallNew() {
new Node(0);
}
// CHECK-LABEL: FunctionTemplateDecl {{.*}} CallNew
// CHECK: |-FunctionDecl {{.*}} CallNew 'void ()'
// CHECK: `-CXXNewExpr {{.*}} 'operator new'
// CHECK: `-CXXParenListInitExpr {{.*}} 'Node'
// CHECK: `-ImplicitCastExpr {{.*}} 'long' <IntegralCast>
// CHECK: `-IntegerLiteral {{.*}} 'int' 0
// CHECK: `-FunctionDecl {{.*}} used CallNew 'void ()' implicit_instantiation
// CHECK: |-TemplateArgument integral 'true'
// CHECK: `-CXXNewExpr {{.*}} 'operator new'
// CHECK: `-CXXParenListInitExpr {{.*}} 'Node'
// CHECK: `-ImplicitCastExpr {{.*}} 'long' <IntegralCast>
// CHECK: `-IntegerLiteral {{.*}} 'int' 0
void f() {
(void)CallNew<true>;
}
|