diff options
author | Nathan Sidwell <nathan@acm.org> | 2020-04-21 06:46:42 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2020-04-21 06:50:36 -0700 |
commit | f2c8be187e8eb061e44166ac41646285821be6a6 (patch) | |
tree | c8baa0d930c4da9f136719fcb48c3445539bf09f /gcc/cp/pt.c | |
parent | 15256c8a8ac6573d250506c40dbe13082186c2aa (diff) | |
download | gcc-f2c8be187e8eb061e44166ac41646285821be6a6.zip gcc-f2c8be187e8eb061e44166ac41646285821be6a6.tar.gz gcc-f2c8be187e8eb061e44166ac41646285821be6a6.tar.bz2 |
c++: ICE with ptr_plus_expr
An ICE on darwin, when a SFINAE-context substitution produced
error_mark_node foo an operand of a POINTER_PLUS_EXPR.
fold_build_pointer_plus is unprepared to deal with that, so we need to
check earlier. We had no luck reducing the testcase to something
manageable.
* pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
error_mark_node.
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index cd6392a..6f74c27 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -19409,7 +19409,11 @@ tsubst_copy_and_build (tree t, case POINTER_PLUS_EXPR: { tree op0 = RECUR (TREE_OPERAND (t, 0)); + if (op0 == error_mark_node) + RETURN (error_mark_node); tree op1 = RECUR (TREE_OPERAND (t, 1)); + if (op1 == error_mark_node) + RETURN (error_mark_node); RETURN (fold_build_pointer_plus (op0, op1)); } |