[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-10 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

Kai Tietz  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Kai Tietz  ---
Fixed.  As it is an error on invalid-code, it won't get backported
automatically.  Close it.


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-10 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

--- Comment #7 from Kai Tietz  ---
Author: ktietz
Date: Wed Dec 10 11:26:47 2014
New Revision: 218572

URL: https://gcc.gnu.org/viewcvs?rev=218572&root=gcc&view=rev
Log:
PR c++/64100
* g++.dg/template/pr64100.C: New file.


Added:
trunk/gcc/testsuite/g++.dg/template/pr64100.C
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-10 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

--- Comment #6 from Kai Tietz  ---
Author: ktietz
Date: Wed Dec 10 11:22:34 2014
New Revision: 218571

URL: https://gcc.gnu.org/viewcvs?rev=218571&root=gcc&view=rev
Log:
PR c++/64100
* typeck.c (lookup_destructor): Handle incomplete type.


Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-04 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

Kai Tietz  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #5 from Kai Tietz  ---
(In reply to Jason Merrill from comment #4)
> (In reply to Kai Tietz from comment #2)
> > Following patch fixes this issue for me:
> 
> Were you going to send the patch to the list?

Yes, I will send it today to ML.  I will put you CC.

> > +  if (!expr)
> > +{
> > +  cxx_incomplete_type_error (dtor_name, dtor_type);
> > +  return error_mark_node;
> > +}
> 
> The error needs to be conditional on (complain & tf_error).

Ok, I'll add that.

> Does the caller handle error_mark_node properly?

Yes, I tested it before.  By just returning error_mark_node the testcase will
be processed completely silently by g++.


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-03 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

Jason Merrill  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #4 from Jason Merrill  ---
(In reply to Kai Tietz from comment #2)
> Following patch fixes this issue for me:

Were you going to send the patch to the list?

> +  if (!expr)
> +{
> +  cxx_incomplete_type_error (dtor_name, dtor_type);
> +  return error_mark_node;
> +}

The error needs to be conditional on (complain & tf_error).

Does the caller handle error_mark_node properly?


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-03 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Yeah, r160250 still errored out on it, r160311 already ICEs.


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-03 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

Kai Tietz  changed:

   What|Removed |Added

 CC||ktietz at gcc dot gnu.org

--- Comment #2 from Kai Tietz  ---
Issue is that lookup_destructor calls adjust_result_of_qualified_name_lookup
with an NULL_TREE decl (returned by lookup_member).  Here the error-check seems
to be missing.

Following patch fixes this issue for me:
Index: typeck.c
===
--- typeck.c(Revision 218142)
+++ typeck.c(Arbeitskopie)
@@ -2536,6 +2536,11 @@ lookup_destructor (tree object, tree scope, tree d
   expr = lookup_member (dtor_type, complete_dtor_identifier,
/*protect=*/1, /*want_type=*/false,
tf_warning_or_error);
+  if (!expr)
+{
+  cxx_incomplete_type_error (dtor_name, dtor_type);
+  return error_mark_node;
+}
   expr = (adjust_result_of_qualified_name_lookup
  (expr, dtor_type, object_type));
   if (scope == NULL_TREE)
Index: search.c
===
--- search.c(Revision 218142)
+++ search.c(Arbeitskopie)
@@ -1530,6 +1530,9 @@ adjust_result_of_qualified_name_lookup (tree decl,
tree qualifying_scope,
tree context_class)
 {
+  if (!decl)
+return NULL_TREE;
+
   if (context_class && context_class != error_mark_node
   && CLASS_TYPE_P (context_class)
   && CLASS_TYPE_P (qualifying_scope)

The change to search.c isn't really required, but avoids to show the ice in
adjust_result_of_qualifying.


[Bug c++/64100] A static assert using the the current class in a noexcept test leads to a segfault

2014-12-03 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64100

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-03
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |4.8.4
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
I see ICE even with 4.6.