Commit 11c0183
c++, contracts: omit unnecessary const-wrappers
We need to view class pointers as const, which we do by wrapping
them in a view convert expression. However, we do not need to do
this if the original is already const-qualified.
gcc/cp/ChangeLog:
* contracts.cc (view_as_const): Check for const-qualified
class pointer before wrapping it.
* parser.cc (cp_parser_late_contract_condition): Use revised
handling of const-ification of class pointers.
(cp_parser_contract_assert): Likewise.
(cp_parser_function_contract_specifier): Likewise.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
Co-authored-by: Jason Merrill <jason@redhat.com>1 parent f3c25c5 commit 11c0183
2 files changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
| 486 | + | |
486 | 487 | | |
| 488 | + | |
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33582 | 33582 | | |
33583 | 33583 | | |
33584 | 33584 | | |
33585 | | - | |
33586 | | - | |
33587 | | - | |
| 33585 | + | |
33588 | 33586 | | |
33589 | 33587 | | |
33590 | 33588 | | |
| |||
33691 | 33689 | | |
33692 | 33690 | | |
33693 | 33691 | | |
33694 | | - | |
33695 | | - | |
| 33692 | + | |
33696 | 33693 | | |
33697 | 33694 | | |
33698 | 33695 | | |
| |||
33857 | 33854 | | |
33858 | 33855 | | |
33859 | 33856 | | |
33860 | | - | |
33861 | | - | |
| 33857 | + | |
33862 | 33858 | | |
33863 | 33859 | | |
33864 | 33860 | | |
| |||
0 commit comments