| 1 |
struct Foo { |
| 2 |
// Those are not explicit conversion functions |
| 3 |
operator int(); |
| 4 |
explicit(false) operator float(); |
| 5 |
|
| 6 |
// Those are explicit conversion functions |
| 7 |
explicit operator double(); |
| 8 |
explicit(true) operator unsigned char(); |
| 9 |
}; |
| 10 |
|
| 11 |
// RUN: c-index-test -test-print-type --std=c++20 %s | FileCheck %s |
| 12 |
// CHECK: StructDecl=Foo:1:8 (Definition) [type=Foo] [typekind=Record] |
| 13 |
// CHECK: CXXConversion=operator int:3:5 [type=int ()] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0] [isAnonRecDecl=0] |
| 14 |
// CHECK: CXXConversion=operator float:4:21 [type=float ()] [typekind=FunctionProto] [resulttype=float] [resulttypekind=Float] [isPOD=0] [isAnonRecDecl=0] |
| 15 |
// CHECK: CXXConversion=operator double:7:14 (explicit) [type=double ()] [typekind=FunctionProto] [resulttype=double] [resulttypekind=Double] [isPOD=0] [isAnonRecDecl=0] |
| 16 |
// CHECK: CXXConversion=operator unsigned char:8:20 (explicit) [type=unsigned char ()] [typekind=FunctionProto] [resulttype=unsigned char] [resulttypekind=UChar] [isPOD=0] [isAnonRecDecl=0] |