aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-04-22 15:13:19 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-04-22 15:13:19 -0400
commitcefb0898ebc75fefdd2cf93d39e6ccbb1aa7ee51 (patch)
treed868d60c1c1606a1758b985b543827aeb40e55f4 /gcc/cp
parent08afbd3bcaa0c6ca8ec54fddaf80dac5b97a659c (diff)
downloadgcc-cefb0898ebc75fefdd2cf93d39e6ccbb1aa7ee51.zip
gcc-cefb0898ebc75fefdd2cf93d39e6ccbb1aa7ee51.tar.gz
gcc-cefb0898ebc75fefdd2cf93d39e6ccbb1aa7ee51.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/semantics.c3
2 files changed, 5 insertions, 1 deletions
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 <jason@redhat.com>
+ * 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 "