[Bug c++/77496] ICE in instantiate_type, at cp/class.c:8270
bernd.edlinger at hotmail dot de
gcc-bugzilla@gcc.gnu.org
Tue Sep 6 10:12:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77496
--- Comment #2 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
possible fix:
--- a/gcc-7-20160904/gcc/cp/class.c 2016-08-26 17:10:57.000000000 +0200
+++ b/gcc-7-20160904/gcc/cp/class.c 2016-09-06 11:55:27.252138088 +0200
@@ -8262,6 +8262,11 @@ instantiate_type (tree lhstype, tree rhs
return error_mark_node;
}
+ /* If we instantiate a template, and it is a A ?: C expression
+ with omitted B. */
+ if (TREE_CODE (rhs) == SAVE_EXPR)
+ rhs = TREE_OPERAND (rhs, 0);
+
/* There only a few kinds of expressions that may have a type
dependent on overload resolution. */
gcc_assert (TREE_CODE (rhs) == ADDR_EXPR
More information about the Gcc-bugs
mailing list