]> gcc.gnu.org Git - gcc.git/commit
Objective-C++ : Fix ICE in potential_constant_expression_1.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 31 Oct 2020 09:25:47 +0000 (09:25 +0000)
committerMarek Polacek <polacek@redhat.com>
Thu, 14 Jan 2021 17:33:48 +0000 (12:33 -0500)
commit3e08dcab3aaa7916d782cb5994f269bbfc216cdc
treef602ec59ee43cf68fecef433a8831f52917cffdd
parent1e151fb43523ff2c60540cff2518dba4ecd64f71
Objective-C++ : Fix ICE in potential_constant_expression_1.

We cannot, as things stand, handle Objective-C tree codes in
the switch and deal with this by calling out to a function that
has a dummy version when Objective-C is not enabled.

Because of the way the logic works (with a fall through to a
'sorry' in case of unhandled expressions), the function reports
cases that are known to be unsuitable for constant exprs. The
dummy function always reports 'false' and thus will fall through
to the 'sorry'.

gcc/c-family/ChangeLog:

* c-objc.h (objc_non_constant_expr_p): New.
* stub-objc.c (objc_non_constant_expr_p): New.

gcc/cp/ChangeLog:

* constexpr.c (potential_constant_expression_1): Handle
expressions known to be non-constant for Objective-C.

gcc/objc/ChangeLog:

* objc-act.c (objc_non_constant_expr_p): New.

(cherry picked from commit 878cffbd9e6e1b138a6e0d362e7b29bc0a259940)
gcc/c-family/c-objc.h
gcc/c-family/stub-objc.c
gcc/cp/constexpr.c
gcc/objc/objc-act.c
This page took 0.060555 seconds and 6 git commands to generate.