This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch c++]: Fix PR/64100 'A static assert using the the current class in a noexcept test leads to a segfault'


Hi,

 The issue is that lookup_destructor calls
adjust_result_of_qualified_name_lookup
with an NULL_TREE decl (returned by lookup_member).  So error-message
is missing.

As already discussed in bug-tracker:

ChangeLog

2014-12-04  Kai Tietz  <ktietz@redhat.com>

    PR c++/64100
    * typeck.c (lookup_destructor): Handle incomplete
    type.

Tested on x86_64-unknown-linux-gnu.

Ok for apply?

Kai
Index: typeck.c
===================================================================
--- typeck.c    (Revision 218309)
+++ typeck.c    (Arbeitskopie)
@@ -2536,6 +2535,12 @@ 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)
+    {
+      if (complain & tf_error)
+    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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]