From e383e095ce0e6973f42a3d3948c667c60f0d82a8 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Wed, 10 Dec 2014 12:22:34 +0100 Subject: [PATCH] re PR c++/64100 (A static assert using the the current class in a noexcept test leads to a segfault) PR c++/64100 * typeck.c (lookup_destructor): Handle incomplete type. From-SVN: r218571 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/typeck.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 484dd286369..a3d8d995853 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-10 Kai Tietz + + PR c++/64100 + * typeck.c (lookup_destructor): Handle incomplete type. + 2014-12-09 Jason Merrill PR c++/64129 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index ae84b63c145..2abff6bdb76 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2536,6 +2536,12 @@ lookup_destructor (tree object, tree scope, tree dtor_name, 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) -- 2.30.2