2023-02-22 22:37:59 +00:00
|
|
|
definitions = '''
|
|
|
|
class A {
|
|
|
|
int f;
|
|
|
|
int g;
|
|
|
|
};
|
|
|
|
|
|
|
|
class B {
|
|
|
|
int h;
|
|
|
|
};
|
|
|
|
|
|
|
|
class C {
|
|
|
|
public:
|
|
|
|
// using T = std::conditional_t<alignof(int*) >= sizeof(char), A, B>;
|
|
|
|
std::conditional_t<alignof(int*) >= sizeof(char), A, B> foo;
|
|
|
|
};
|
|
|
|
'''
|
|
|
|
[cases]
|
|
|
|
[cases.a]
|
2023-08-16 20:40:36 +01:00
|
|
|
oil_skip = 'not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/317
|
2023-02-22 22:37:59 +00:00
|
|
|
param_types = ["const C&"]
|
|
|
|
setup = '''
|
|
|
|
C foo;
|
|
|
|
return {foo};
|
|
|
|
'''
|
|
|
|
expect_json = '''
|
|
|
|
[
|
|
|
|
{
|
2023-12-13 16:49:41 +00:00
|
|
|
"typeName": "ns_std_conditional::C",
|
2023-02-22 22:37:59 +00:00
|
|
|
"isTypedef": false,
|
|
|
|
"staticSize": 8,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"name": "foo",
|
|
|
|
"typePath": "foo",
|
|
|
|
"isTypedef": true,
|
|
|
|
"staticSize": 8,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"name": "",
|
|
|
|
"typePath": "",
|
|
|
|
"typeName": "type",
|
|
|
|
"isTypedef": true,
|
|
|
|
"staticSize": 8,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"name": "",
|
|
|
|
"typePath": "",
|
2023-12-13 16:49:41 +00:00
|
|
|
"typeName": "ns_std_conditional::A",
|
2023-02-22 22:37:59 +00:00
|
|
|
"isTypedef": false,
|
|
|
|
"staticSize": 8,
|
|
|
|
"dynamicSize": 0,
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"name": "f",
|
|
|
|
"typePath": "f",
|
|
|
|
"isTypedef": false,
|
|
|
|
"staticSize": 4,
|
|
|
|
"dynamicSize": 0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "g",
|
|
|
|
"typePath": "g",
|
|
|
|
"isTypedef": false,
|
|
|
|
"staticSize": 4,
|
|
|
|
"dynamicSize": 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'''
|