diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2020-10-31 09:25:47 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2020-11-04 08:06:13 +0000 |
commit | 878cffbd9e6e1b138a6e0d362e7b29bc0a259940 (patch) | |
tree | 68cbe595c0a38ade3813ac1e25e631f12998840e /gcc/cp/constexpr.c | |
parent | c19e44ac8dbc9af07e5e671edfa03ab5b08649c5 (diff) | |
download | gcc-878cffbd9e6e1b138a6e0d362e7b29bc0a259940.zip gcc-878cffbd9e6e1b138a6e0d362e7b29bc0a259940.tar.gz gcc-878cffbd9e6e1b138a6e0d362e7b29bc0a259940.tar.bz2 |
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.
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 7033a49..b6f9c43 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -8413,7 +8413,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now, return false; default: - if (objc_is_property_ref (t)) + if (objc_non_constant_expr_p (t)) return false; sorry ("unexpected AST of kind %s", get_tree_code_name (TREE_CODE (t))); |