From cefb0898ebc75fefdd2cf93d39e6ccbb1aa7ee51 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 22 Apr 2013 15:13:19 -0400 Subject: 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 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/semantics.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b8c4727..dffab2c 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 391dc1e..2b8ceb2 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 " -- cgit v1.1