This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch c++]: Fix PR/64100 'A static assert using the the current class in a noexcept test leads to a segfault'
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Thu, 4 Dec 2014 16:00:34 +0100
- Subject: [patch c++]: Fix PR/64100 'A static assert using the the current class in a noexcept test leads to a segfault'
- Authentication-results: sourceware.org; auth=none
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)