Commit 9a822d6
Fixes for type traits handling of cv-qualified array types
cv-qualified arrays were not being handled correctly by type traits
manipulations functions. For instance, 'int const[N]' would not be
detected as 'const'. Similar problems existed for volatile qualified
arrays too.
There is a difference in behavior between GCCXML and CastXML for cv-qual
arrays. GCCXML produces the following nesting of types:
-> volatile_t(const_t(array_t))
while CastXML produces the following nesting:
-> array_t(volatile_t(const_t))
For both cases, we must unwrap the types, remove const_t, and add back
the outer layers.
Prior to CastXML/CastXML#55 being fixed, CastXML would incorrectly
generate default constructor definitions for types with const data
members. This caused pygccxml to incorrectly flag such types as
trivially constructible.
These tests have now been fixed, and the tests are being executed
conditionally only for GCCXML (which handles them correctly), or, if
CastXML is being used, then for xml_output_version >= 1.138.
gccxml places cv-qualifiers to the right of the array declarator in the
decl_string. For instance, given the declaration 'int const[arr[42]',
the decl_string from gccxml is 'int [42] const'.
Combined type_traits_castxml.hpp and type_traits_gccxml.hpp into a
single file - type_traits.hpp.
Change-Id: If5deaecf4cc9ab38cb8b8ac90befa9c62ebd0106
This commit was cherry-picked from the develop branch.
Conflicts:
unittests/data/type_traits_castxml.hpp
unittests/type_traits_tester.py
Note: the decl_type attributes in array_bug_tester.py were replaced
by type attributes. The decl_type attributes only exist on develop.1 parent f03e719 commit 9a822d6
File tree
5 files changed
+193
-898
lines changed- pygccxml/declarations
- unittests
- data
5 files changed
+193
-898
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
288 | 294 | | |
289 | 295 | | |
290 | | - | |
| 296 | + | |
291 | 297 | | |
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
295 | 301 | | |
296 | | - | |
| 302 | + | |
297 | 303 | | |
298 | | - | |
| 304 | + | |
299 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
300 | 327 | | |
301 | 328 | | |
302 | 329 | | |
| |||
322 | 349 | | |
323 | 350 | | |
324 | 351 | | |
325 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
326 | 359 | | |
327 | 360 | | |
328 | 361 | | |
| |||
334 | 367 | | |
335 | 368 | | |
336 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
337 | 380 | | |
338 | 381 | | |
339 | 382 | | |
| |||
344 | 387 | | |
345 | 388 | | |
346 | 389 | | |
347 | | - | |
348 | | - | |
| 390 | + | |
| 391 | + | |
349 | 392 | | |
350 | | - | |
| 393 | + | |
351 | 394 | | |
352 | | - | |
| 395 | + | |
353 | 396 | | |
354 | 397 | | |
355 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
58 | 117 | | |
59 | 118 | | |
60 | 119 | | |
| |||
Lines changed: 60 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | | - | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
| |||
287 | 285 | | |
288 | 286 | | |
289 | 287 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | 288 | | |
296 | 289 | | |
297 | 290 | | |
| |||
409 | 402 | | |
410 | 403 | | |
411 | 404 | | |
412 | | - | |
| 405 | + | |
| 406 | + | |
413 | 407 | | |
414 | 408 | | |
415 | 409 | | |
| |||
421 | 415 | | |
422 | 416 | | |
423 | 417 | | |
| 418 | + | |
424 | 419 | | |
425 | 420 | | |
426 | 421 | | |
427 | 422 | | |
428 | | - | |
429 | 423 | | |
430 | 424 | | |
431 | 425 | | |
432 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
433 | 436 | | |
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
440 | 452 | | |
441 | 453 | | |
442 | 454 | | |
443 | 455 | | |
444 | 456 | | |
445 | 457 | | |
446 | 458 | | |
| 459 | + | |
| 460 | + | |
447 | 461 | | |
448 | 462 | | |
449 | 463 | | |
| 464 | + | |
450 | 465 | | |
451 | 466 | | |
452 | 467 | | |
| |||
463 | 478 | | |
464 | 479 | | |
465 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
466 | 490 | | |
467 | 491 | | |
468 | 492 | | |
469 | 493 | | |
470 | 494 | | |
471 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
472 | 505 | | |
473 | 506 | | |
474 | 507 | | |
| |||
488 | 521 | | |
489 | 522 | | |
490 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
491 | 530 | | |
492 | 531 | | |
493 | 532 | | |
| |||
504 | 543 | | |
505 | 544 | | |
506 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
507 | 552 | | |
508 | 553 | | |
509 | 554 | | |
| |||
548 | 593 | | |
549 | 594 | | |
550 | 595 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | 596 | | |
555 | 597 | | |
556 | 598 | | |
| |||
567 | 609 | | |
568 | 610 | | |
569 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
570 | 615 | | |
571 | 616 | | |
572 | 617 | | |
| |||
663 | 708 | | |
664 | 709 | | |
665 | 710 | | |
| 711 | + | |
666 | 712 | | |
667 | 713 | | |
668 | 714 | | |
| |||
0 commit comments