From: Jason Merrill Date: Mon, 22 Apr 2013 19:13:19 +0000 (-0400) Subject: semantics.c (potential_constant_expression_1): Don't crash on 'this' in NSDMI. X-Git-Tag: releases/gcc-4.9.0~6326 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cefb0898ebc75fefdd2cf93d39e6ccbb1aa7ee51;p=thirdparty%2Fgcc.git semantics.c (potential_constant_expression_1): Don't crash on 'this' in NSDMI. * semantics.c (potential_constant_expression_1): Don't crash on 'this' in NSDMI. From-SVN: r198154 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b8c4727d6aeb..dffab2c26256 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2013-04-22 Jason Merrill + * semantics.c (potential_constant_expression_1): Don't crash on + 'this' in NSDMI. + Core 1612 * semantics.c (finish_id_expression): Reject capture of anonymous union member. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 391dc1e558a8..2b8ceb26fc7e 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -8442,7 +8442,8 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) tree x = get_nth_callarg (t, 0); if (is_this_parameter (x)) { - if (DECL_CONSTRUCTOR_P (DECL_CONTEXT (x))) + if (DECL_CONTEXT (x) == NULL_TREE + || DECL_CONSTRUCTOR_P (DECL_CONTEXT (x))) { if (flags & tf_error) sorry ("calling a member function of the "