brintos

brintos / llvm-project-archived public Read only

0
0
Text · 815 B · c47239e Raw
24 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -fsyntax-only -ast-dump %s | FileCheck %s2struct Node {3  long val;4};5template <bool>6void CallNew() {7    new Node(0);8}9// CHECK-LABEL: FunctionTemplateDecl {{.*}} CallNew10// CHECK: |-FunctionDecl {{.*}} CallNew 'void ()'11// CHECK:  `-CXXNewExpr {{.*}} 'operator new'12// CHECK:  `-CXXParenListInitExpr {{.*}} 'Node'13// CHECK:  `-ImplicitCastExpr {{.*}} 'long' <IntegralCast>14// CHECK:  `-IntegerLiteral {{.*}} 'int' 015// CHECK: `-FunctionDecl {{.*}} used CallNew 'void ()' implicit_instantiation16// CHECK:   |-TemplateArgument integral 'true'17// CHECK:   `-CXXNewExpr {{.*}} 'operator new'18// CHECK:   `-CXXParenListInitExpr {{.*}} 'Node'19// CHECK:   `-ImplicitCastExpr {{.*}} 'long' <IntegralCast>20// CHECK:   `-IntegerLiteral {{.*}} 'int' 021void f() {22    (void)CallNew<true>; 23}24