diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -5912,7 +5912,6 @@ continue; QualType UDeclTy = UDecl->getType(); - // TODO: Verify types for templates eventually. if (!UDeclTy->isDependentType()) { QualType NewType = Context.mergeFunctionTypes( FType, UDeclTy, /* OfBlockPointer */ false, @@ -6000,6 +5999,8 @@ TargetOMPContext OMPCtx(Context, std::move(DiagUnknownTrait), getCurFunctionDecl()); + QualType CalleeFnType = CalleeFnDecl->getType(); + SmallVector Exprs; SmallVector VMIs; while (CalleeFnDecl) { @@ -6052,8 +6053,17 @@ } NewCall = BuildCallExpr(Scope, BestExpr, LParenLoc, ArgExprs, RParenLoc, ExecConfig); - if (NewCall.isUsable()) - break; + if (NewCall.isUsable()) { + NewCall.get()->dump(); + if (CallExpr *NCE = dyn_cast(NewCall.get())) { + FunctionDecl *NewCalleeFnDecl = NCE->getDirectCallee(); + if (Context.typesAreCompatible(CalleeFnType, + NewCalleeFnDecl->getType())) + break; + // Don't use the call if the function type was not compatible. + NewCall = nullptr; + } + } } VMIs.erase(VMIs.begin() + BestIdx); diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp b/clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp new file mode 100644 --- /dev/null +++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp @@ -0,0 +1,241 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s +// expected-no-diagnostics +// PR47655 + +template struct S { + S(int) {} +}; + +template +int also_before(T s) { + return 0; +} + +#pragma omp begin declare variant match(implementation = {extension(allow_templates)}) +template +int also_before(S s) { + return 1; +} +template +int special(S s) { + return 0; +} +template +int also_after(S s) { + return 2; +} +#pragma omp end declare variant + +template +int also_after(T s) { + return 0; +} + +int test() { + // Should return 0. + return also_before(0) + also_after(0) + also_before(0.) + also_after(0.) + special(S(0)); +} + +// CHECK: |-ClassTemplateDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:30 S +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_1:0x[a-z0-9]*]] col:20 typename depth 0 index 0 T +// CHECK-NEXT: | |-CXXRecordDecl [[ADDR_2:0x[a-z0-9]*]] line:5:30 struct S definition +// CHECK-NEXT: | | |-DefinitionData empty standard_layout trivially_copyable has_user_declared_ctor can_const_default_init +// CHECK-NEXT: | | | |-DefaultConstructor defaulted_is_constexpr +// CHECK-NEXT: | | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param +// CHECK-NEXT: | | | |-MoveConstructor exists simple trivial needs_implicit +// CHECK-NEXT: | | | |-CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param +// CHECK-NEXT: | | | |-MoveAssignment exists simple trivial needs_implicit +// CHECK-NEXT: | | | `-Destructor simple irrelevant trivial needs_implicit +// CHECK-NEXT: | | |-CXXRecordDecl [[ADDR_3:0x[a-z0-9]*]] col:30 implicit referenced struct S +// CHECK-NEXT: | | `-CXXConstructorDecl [[ADDR_4:0x[a-z0-9]*]] col:3 S 'void (int)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_5:0x[a-z0-9]*]] col:8 'int' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_6:0x[a-z0-9]*]] +// CHECK-NEXT: | |-ClassTemplateSpecializationDecl [[ADDR_7:0x[a-z0-9]*]] line:5:30 struct S definition +// CHECK-NEXT: | | |-DefinitionData pass_in_registers empty standard_layout trivially_copyable has_user_declared_ctor can_const_default_init +// CHECK-NEXT: | | | |-DefaultConstructor defaulted_is_constexpr +// CHECK-NEXT: | | | |-CopyConstructor simple trivial has_const_param implicit_has_const_param +// CHECK-NEXT: | | | |-MoveConstructor exists simple trivial +// CHECK-NEXT: | | | |-CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param +// CHECK-NEXT: | | | |-MoveAssignment exists simple trivial needs_implicit +// CHECK-NEXT: | | | `-Destructor simple irrelevant trivial +// CHECK-NEXT: | | |-TemplateArgument type 'int' +// CHECK-NEXT: | | | `-BuiltinType [[ADDR_8:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | |-CXXRecordDecl [[ADDR_9:0x[a-z0-9]*]] prev [[ADDR_7]] col:30 implicit struct S +// CHECK-NEXT: | | |-CXXConstructorDecl [[ADDR_10:0x[a-z0-9]*]] col:3 used S 'void (int)' +// CHECK-NEXT: | | | |-ParmVarDecl [[ADDR_11:0x[a-z0-9]*]] col:8 'int' +// CHECK-NEXT: | | | `-CompoundStmt [[ADDR_6]] +// CHECK-NEXT: | | |-CXXConstructorDecl [[ADDR_12:0x[a-z0-9]*]] col:30 implicit constexpr S 'void (const S &)' inline default trivial noexcept-unevaluated [[ADDR_12]] +// CHECK-NEXT: | | | `-ParmVarDecl [[ADDR_13:0x[a-z0-9]*]] col:30 'const S &' +// CHECK-NEXT: | | |-CXXConstructorDecl [[ADDR_14:0x[a-z0-9]*]] col:30 implicit used constexpr S 'void (S &&) noexcept' inline default trivial +// CHECK-NEXT: | | | |-ParmVarDecl [[ADDR_15:0x[a-z0-9]*]] col:30 'S &&' +// CHECK-NEXT: | | | `-CompoundStmt [[ADDR_16:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-CXXDestructorDecl [[ADDR_17:0x[a-z0-9]*]] col:30 implicit referenced ~S 'void ({{.*}}) noexcept' inline default trivial +// CHECK-NEXT: | `-ClassTemplateSpecializationDecl [[ADDR_18:0x[a-z0-9]*]] line:5:30 struct S definition +// CHECK-NEXT: | |-DefinitionData pass_in_registers empty standard_layout trivially_copyable has_user_declared_ctor can_const_default_init +// CHECK-NEXT: | | |-DefaultConstructor defaulted_is_constexpr +// CHECK-NEXT: | | |-CopyConstructor simple trivial has_const_param implicit_has_const_param +// CHECK-NEXT: | | |-MoveConstructor exists simple trivial +// CHECK-NEXT: | | |-CopyAssignment simple trivial has_const_param needs_implicit implicit_has_const_param +// CHECK-NEXT: | | |-MoveAssignment exists simple trivial needs_implicit +// CHECK-NEXT: | | `-Destructor simple irrelevant trivial +// CHECK-NEXT: | |-TemplateArgument type 'double' +// CHECK-NEXT: | | `-BuiltinType [[ADDR_19:0x[a-z0-9]*]] 'double' +// CHECK-NEXT: | |-CXXRecordDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_18]] col:30 implicit struct S +// CHECK-NEXT: | |-CXXConstructorDecl [[ADDR_21:0x[a-z0-9]*]] col:3 used S 'void (int)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_22:0x[a-z0-9]*]] col:8 'int' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_6]] +// CHECK-NEXT: | |-CXXConstructorDecl [[ADDR_23:0x[a-z0-9]*]] col:30 implicit constexpr S 'void (const S &)' inline default trivial noexcept-unevaluated [[ADDR_23]] +// CHECK-NEXT: | | `-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] col:30 'const S &' +// CHECK-NEXT: | |-CXXConstructorDecl [[ADDR_25:0x[a-z0-9]*]] col:30 implicit used constexpr S 'void (S &&) noexcept' inline default trivial +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_26:0x[a-z0-9]*]] col:30 'S &&' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_27:0x[a-z0-9]*]] +// CHECK-NEXT: | `-CXXDestructorDecl [[ADDR_28:0x[a-z0-9]*]] col:30 implicit referenced ~S 'void ({{.*}}) noexcept' inline default trivial +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_29:0x[a-z0-9]*]] line:10:5 also_before +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_30:0x[a-z0-9]*]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | |-FunctionDecl [[ADDR_31:0x[a-z0-9]*]] line:10:5 also_before 'int (T)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_32:0x[a-z0-9]*]] col:19 s 'T' +// CHECK-NEXT: | | |-CompoundStmt [[ADDR_33:0x[a-z0-9]*]] +// CHECK-NEXT: | | | `-ReturnStmt [[ADDR_34:0x[a-z0-9]*]] +// CHECK-NEXT: | | | `-IntegerLiteral [[ADDR_35:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | | `-OMPDeclareVariantAttr [[ADDR_36:0x[a-z0-9]*]] <> Implicit implementation={extension(allow_templates)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_37:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_38:0x[a-z0-9]*]] 'also_before[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: | |-FunctionDecl [[ADDR_39:0x[a-z0-9]*]] line:10:5 used also_before 'int (int)' +// CHECK-NEXT: | | |-TemplateArgument type 'int' +// CHECK-NEXT: | | | `-BuiltinType [[ADDR_8]] 'int' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_40:0x[a-z0-9]*]] col:19 s 'int':'int' +// CHECK-NEXT: | | |-CompoundStmt [[ADDR_41:0x[a-z0-9]*]] +// CHECK-NEXT: | | | `-ReturnStmt [[ADDR_42:0x[a-z0-9]*]] +// CHECK-NEXT: | | | `-IntegerLiteral [[ADDR_35]] 'int' 0 +// CHECK-NEXT: | | `-OMPDeclareVariantAttr [[ADDR_43:0x[a-z0-9]*]] <> Implicit implementation={extension(allow_templates)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_44:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_45:0x[a-z0-9]*]] 'also_before[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: | `-FunctionDecl [[ADDR_46:0x[a-z0-9]*]] line:10:5 used also_before 'int (double)' +// CHECK-NEXT: | |-TemplateArgument type 'double' +// CHECK-NEXT: | | `-BuiltinType [[ADDR_19]] 'double' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_47:0x[a-z0-9]*]] col:19 s 'double':'double' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_48:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_49:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_35]] 'int' 0 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_50:0x[a-z0-9]*]] <> Implicit implementation={extension(allow_templates)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_51:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_52:0x[a-z0-9]*]] 'also_before[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_53:0x[a-z0-9]*]] line:16:1 also_before[implementation={extension(allow_templates)}] +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_54:0x[a-z0-9]*]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | |-FunctionDecl [[ADDR_38]] line:16:1 referenced also_before[implementation={extension(allow_templates)}] 'int (S)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_55:0x[a-z0-9]*]] col:22 s 'S' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_56:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_57:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_58:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: | |-FunctionDecl [[ADDR_45]] line:16:1 also_before[implementation={extension(allow_templates)}] 'int (S)' +// CHECK-NEXT: | | |-TemplateArgument type 'int' +// CHECK-NEXT: | | | `-BuiltinType [[ADDR_8]] 'int' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_59:0x[a-z0-9]*]] col:22 s 'S':'S' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_60:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_61:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_58]] 'int' 1 +// CHECK-NEXT: | `-FunctionDecl [[ADDR_52]] line:16:1 also_before[implementation={extension(allow_templates)}] 'int (S)' +// CHECK-NEXT: | |-TemplateArgument type 'double' +// CHECK-NEXT: | | `-BuiltinType [[ADDR_19]] 'double' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_62:0x[a-z0-9]*]] col:22 s 'S':'S' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_63:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_64:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_58]] 'int' 1 +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_65:0x[a-z0-9]*]] col:5 implicit special +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_66:0x[a-z0-9]*]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | |-FunctionDecl [[ADDR_67:0x[a-z0-9]*]] col:5 special 'int (S)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_68:0x[a-z0-9]*]] col:18 s 'S' +// CHECK-NEXT: | | `-OMPDeclareVariantAttr [[ADDR_69:0x[a-z0-9]*]] <> Implicit implementation={extension(allow_templates)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_71:0x[a-z0-9]*]] 'special[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: | `-FunctionDecl [[ADDR_72:0x[a-z0-9]*]] col:5 used special 'int (S)' +// CHECK-NEXT: | |-TemplateArgument type 'int' +// CHECK-NEXT: | | `-BuiltinType [[ADDR_8]] 'int' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_73:0x[a-z0-9]*]] col:18 s 'S':'S' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_74:0x[a-z0-9]*]] <> Implicit implementation={extension(allow_templates)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_75:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_76:0x[a-z0-9]*]] 'special[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_77:0x[a-z0-9]*]] line:20:1 special[implementation={extension(allow_templates)}] +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_66]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | |-FunctionDecl [[ADDR_71]] line:20:1 referenced special[implementation={extension(allow_templates)}] 'int (S)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_68]] col:18 s 'S' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_78:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_79:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_80:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | `-FunctionDecl [[ADDR_76]] line:20:1 special[implementation={extension(allow_templates)}] 'int (S)' +// CHECK-NEXT: | |-TemplateArgument type 'int' +// CHECK-NEXT: | | `-BuiltinType [[ADDR_8]] 'int' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_81:0x[a-z0-9]*]] col:18 s 'S':'S' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_82:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_83:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_80]] 'int' 0 +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_84:0x[a-z0-9]*]] col:5 implicit also_after +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_85:0x[a-z0-9]*]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | `-FunctionDecl [[ADDR_86:0x[a-z0-9]*]] col:5 also_after 'int (S)' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_87:0x[a-z0-9]*]] col:21 s 'S' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_88:0x[a-z0-9]*]] <> Implicit implementation={extension(allow_templates)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_89:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_90:0x[a-z0-9]*]] 'also_after[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_91:0x[a-z0-9]*]] line:24:1 also_after[implementation={extension(allow_templates)}] +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_85]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | `-FunctionDecl [[ADDR_90]] line:24:1 also_after[implementation={extension(allow_templates)}] 'int (S)' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_87]] col:21 s 'S' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_92:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_93:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_94:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: |-FunctionTemplateDecl [[ADDR_95:0x[a-z0-9]*]] line:30:5 also_after +// CHECK-NEXT: | |-TemplateTypeParmDecl [[ADDR_96:0x[a-z0-9]*]] col:20 referenced typename depth 0 index 0 T +// CHECK-NEXT: | |-FunctionDecl [[ADDR_97:0x[a-z0-9]*]] line:30:5 also_after 'int (T)' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_98:0x[a-z0-9]*]] col:18 s 'T' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_99:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_100:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_101:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | |-FunctionDecl [[ADDR_102:0x[a-z0-9]*]] line:30:5 used also_after 'int (int)' +// CHECK-NEXT: | | |-TemplateArgument type 'int' +// CHECK-NEXT: | | | `-BuiltinType [[ADDR_8]] 'int' +// CHECK-NEXT: | | |-ParmVarDecl [[ADDR_103:0x[a-z0-9]*]] col:18 s 'int':'int' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_104:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_105:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_101]] 'int' 0 +// CHECK-NEXT: | `-FunctionDecl [[ADDR_106:0x[a-z0-9]*]] line:30:5 used also_after 'int (double)' +// CHECK-NEXT: | |-TemplateArgument type 'double' +// CHECK-NEXT: | | `-BuiltinType [[ADDR_19]] 'double' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_107:0x[a-z0-9]*]] col:18 s 'double':'double' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_108:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_109:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_101]] 'int' 0 +// CHECK-NEXT: `-FunctionDecl [[ADDR_110:0x[a-z0-9]*]] line:34:5 test 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_111:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_112:0x[a-z0-9]*]] +// CHECK-NEXT: `-ExprWithCleanups [[ADDR_113:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-BinaryOperator [[ADDR_114:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-BinaryOperator [[ADDR_115:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | |-BinaryOperator [[ADDR_116:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | | |-BinaryOperator [[ADDR_117:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | | | |-CallExpr [[ADDR_118:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | | | |-ImplicitCastExpr [[ADDR_119:0x[a-z0-9]*]] 'int (*)(int)' +// CHECK-NEXT: | | | | | `-DeclRefExpr [[ADDR_120:0x[a-z0-9]*]] 'int (int)' {{.*}}Function [[ADDR_39]] 'also_before' 'int (int)' (FunctionTemplate [[ADDR_29]] 'also_before') +// CHECK-NEXT: | | | | `-IntegerLiteral [[ADDR_121:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | | | `-CallExpr [[ADDR_122:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | | |-ImplicitCastExpr [[ADDR_123:0x[a-z0-9]*]] 'int (*)(int)' +// CHECK-NEXT: | | | | `-DeclRefExpr [[ADDR_124:0x[a-z0-9]*]] 'int (int)' {{.*}}Function [[ADDR_102]] 'also_after' 'int (int)' (FunctionTemplate [[ADDR_95]] 'also_after') +// CHECK-NEXT: | | | `-IntegerLiteral [[ADDR_125:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | | `-CallExpr [[ADDR_126:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | |-ImplicitCastExpr [[ADDR_127:0x[a-z0-9]*]] 'int (*)(double)' +// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_128:0x[a-z0-9]*]] 'int (double)' {{.*}}Function [[ADDR_46]] 'also_before' 'int (double)' (FunctionTemplate [[ADDR_29]] 'also_before') +// CHECK-NEXT: | | `-FloatingLiteral [[ADDR_129:0x[a-z0-9]*]] 'double' 0.000000e+00 +// CHECK-NEXT: | `-CallExpr [[ADDR_130:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-ImplicitCastExpr [[ADDR_131:0x[a-z0-9]*]] 'int (*)(double)' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_132:0x[a-z0-9]*]] 'int (double)' {{.*}}Function [[ADDR_106]] 'also_after' 'int (double)' (FunctionTemplate [[ADDR_95]] 'also_after') +// CHECK-NEXT: | `-FloatingLiteral [[ADDR_133:0x[a-z0-9]*]] 'double' 0.000000e+00 +// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_134:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: |-CallExpr [[ADDR_135:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-ImplicitCastExpr [[ADDR_136:0x[a-z0-9]*]] 'int (*)(S)' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_137:0x[a-z0-9]*]] 'int (S)' {{.*}}Function [[ADDR_72]] 'special' 'int (S)' (FunctionTemplate [[ADDR_65]] 'special') +// CHECK-NEXT: | `-CXXConstructExpr [[ADDR_138:0x[a-z0-9]*]] 'S':'S' 'void (S &&) noexcept' elidable +// CHECK-NEXT: | `-MaterializeTemporaryExpr [[ADDR_139:0x[a-z0-9]*]] 'S':'S' xvalue +// CHECK-NEXT: | `-CXXFunctionalCastExpr [[ADDR_140:0x[a-z0-9]*]] 'S':'S' functional cast to S +// CHECK-NEXT: | `-CXXConstructExpr [[ADDR_141:0x[a-z0-9]*]] 'S':'S' 'void (int)' +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_142:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: `-CallExpr [[ADDR_143:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: |-ImplicitCastExpr [[ADDR_144:0x[a-z0-9]*]] 'int (*)(S)' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_75]] 'int (S)' {{.*}}Function [[ADDR_76]] 'special[implementation={extension(allow_templates)}]' 'int (S)' +// CHECK-NEXT: `-CXXConstructExpr [[ADDR_145:0x[a-z0-9]*]] 'S':'S' 'void (S &&) noexcept' elidable +// CHECK-NEXT: `-MaterializeTemporaryExpr [[ADDR_146:0x[a-z0-9]*]] 'S':'S' xvalue +// CHECK-NEXT: `-CXXFunctionalCastExpr [[ADDR_140]] 'S':'S' functional cast to S +// CHECK-NEXT: `-CXXConstructExpr [[ADDR_141]] 'S':'S' 'void (int)' +// CHECK-NEXT: `-IntegerLiteral [[ADDR_142]] 'int' 0