| 244 | } |
| 245 | |
| 246 | void classTemplateDecl2() { |
| 247 | const char clang[] = "|-ClassTemplateDecl 0x244e748 <a.cpp:1:1, col:59> col:25 C\n" |
| 248 | "| |-TemplateTypeParmDecl 0x244e5f8 <col:10, col:16> col:16 referenced class depth 0 index 0 T\n" |
| 249 | "| |-CXXRecordDecl 0x244e6b0 <col:19, col:59> col:25 class C definition\n" |
| 250 | "| | |-DefinitionData empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init\n" |
| 251 | "| | | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr\n" |
| 252 | "| | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param\n" |
| 253 | "| | | |-MoveConstructor exists simple trivial needs_implicit\n" |
| 254 | "| | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param\n" |
| 255 | "| | | |-MoveAssignment exists simple trivial needs_implicit\n" |
| 256 | "| | | `-Destructor simple irrelevant trivial needs_implicit\n" |
| 257 | "| | |-CXXRecordDecl 0x244e9b0 <col:19, col:25> col:25 implicit class C\n" |
| 258 | "| | |-AccessSpecDecl 0x244ea48 <col:29, col:35> col:29 public\n" |
| 259 | "| | `-CXXMethodDecl 0x244eb20 <col:37, col:57> col:39 foo 'T ()'\n" |
| 260 | "| | `-CompoundStmt 0x244ec18 <col:45, col:57>\n" |
| 261 | "| | `-ReturnStmt 0x244ec00 <col:47, col:54>\n" |
| 262 | "| | `-IntegerLiteral 0x244ebe0 <col:54> 'int' 0\n" |
| 263 | "| `-ClassTemplateSpecializationDecl 0x244ed78 <col:1, col:59> col:25 class C definition\n" |
| 264 | "| |-DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init\n" |
| 265 | "| | |-DefaultConstructor exists trivial constexpr defaulted_is_constexpr\n" |
| 266 | "| | |-CopyConstructor simple trivial has_const_param implicit_has_const_param\n" |
| 267 | "| | |-MoveConstructor exists simple trivial\n" |
| 268 | "| | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param\n" |
| 269 | "| | |-MoveAssignment exists simple trivial needs_implicit\n" |
| 270 | "| | `-Destructor simple irrelevant trivial needs_implicit\n" |
| 271 | "| |-TemplateArgument type 'int'\n" |
| 272 | "| |-CXXRecordDecl 0x244eff0 prev 0x244ed78 <col:19, col:25> col:25 implicit class C\n" |
| 273 | "| |-AccessSpecDecl 0x244f088 <col:29, col:35> col:29 public\n" |
| 274 | "| |-CXXMethodDecl 0x244f160 <col:37, col:57> col:39 used foo 'int ()'\n" |
| 275 | "| | `-CompoundStmt 0x247cb40 <col:45, col:57>\n" |
| 276 | "| | `-ReturnStmt 0x247cb28 <col:47, col:54>\n" |
| 277 | "| | `-IntegerLiteral 0x244ebe0 <col:54> 'int' 0\n" |
| 278 | "| |-CXXConstructorDecl 0x247c540 <col:25> col:25 implicit used constexpr C 'void () noexcept' inline default trivial\n" |
| 279 | "| | `-CompoundStmt 0x247ca00 <col:25>\n" |
| 280 | "| |-CXXConstructorDecl 0x247c658 <col:25> col:25 implicit constexpr C 'void (const C<int> &)' inline default trivial noexcept-unevaluated 0x247c658\n" |
| 281 | "| | `-ParmVarDecl 0x247c790 <col:25> col:25 'const C<int> &'\n" |
| 282 | "| `-CXXConstructorDecl 0x247c828 <col:25> col:25 implicit constexpr C 'void (C<int> &&)' inline default trivial noexcept-unevaluated 0x247c828\n" |
| 283 | "| `-ParmVarDecl 0x247c960 <col:25> col:25 'C<int> &&'\n"; |
| 284 | ASSERT_EQUALS("class C { int foo ( ) { return 0 ; } C ( ) { } C ( const C<int> & ) = default ; C ( C<int> && ) = default ; } ;", parse(clang)); |
| 285 | } |
| 286 | |
| 287 | void conditionalExpr() { |
| 288 | const char clang[] = "`-VarDecl 0x257cc88 <a.cpp:4:1, col:13> col:5 x 'int' cinit\n" |