From patchwork Mon Jun 17 13:42:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1117026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503085-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Bo4aCeP/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Vlt3f8AE"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45SC8B2cdrz9sND for ; Mon, 17 Jun 2019 23:42:47 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=yiKvTkmMwqOu2U3S+eJa9qsc3XqlLa1oS2JZZ27pCPwFqipyI6 dyT2jwJ7XopT2uqBqTYmUqogQiGYlZV2rnLFRFB9DsaA5sIzloUp5nFSQEddzNZn bxYU09FpvEUx1bKeSvhF0szLF5axI2YWHLxa3QA8ZUHH4jnnefZ6DfehU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=3FEm5QsNs4RWOt6VtCHfAEvzqOY=; b=Bo4aCeP/wHfE5Q6X0Et0 hQruZWxRQg5pCKd5/Ch9GXGA3zk8SzKdXGsL8n/rt5MDJ8loes4lIyN6m0unset1 9vQH5eXd9IvKypU+u+H+7lTiXyTo5uzxMJbqdSZeQZjolFILmwdRw5w9i1pDcwxS 0swPlZmjtvsG4Sh/ehRpB0U= Received: (qmail 107988 invoked by alias); 17 Jun 2019 13:42:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107978 invoked by uid 89); 17 Jun 2019 13:42:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*F:D*acm.org, H*r:sk:mail-pf, HX-Spam-Relays-External:sk:mail-pf, HX-HELO:sk:mail-pf X-HELO: mail-pf1-f174.google.com Received: from mail-pf1-f174.google.com (HELO mail-pf1-f174.google.com) (209.85.210.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Jun 2019 13:42:38 +0000 Received: by mail-pf1-f174.google.com with SMTP id i189so5707582pfg.10 for ; Mon, 17 Jun 2019 06:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=rsa4Iiu1y9o49qtGpHnnU6MParceuvk7zVcBjZZ6X/Y=; b=Vlt3f8AE1zyB0IkQcicEuWnzJvA4d+1Pwz0zt5q0iSbiCbce+KgrTPd5LhJd7TzSyD nQxiC/rBJdleRhnfyOQiXAHA4sWrnqbgf9PAjqQmz0WTNzQ3obcCmh6C5f6FX+QWY2B/ WBL1VuPqEKOiCDpFY+dDGpxX/jCDiGv6o05GnQ3Kfg5ZMfCQBdf7SAJscwruRpoiiRlN xzaJn7KexxCaF3UYjnqSnHrnNNcix8otQVCtsfXkNSUSWop/gJOnTUOLayrQmaEFiBQo dIi2Vw4L6+XvvgL9K42vlEPE9p2zW9ykEE4phb7dFqXBvnhMtOwCb7sg2uKarWwYHK9Y /isw== Received: from [172.30.200.132] ([163.114.130.128]) by smtp.googlemail.com with ESMTPSA id y23sm14612964pfm.117.2019.06.17.06.42.35 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 06:42:36 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [PR c++/90754] name lookup ICE Message-ID: Date: Mon, 17 Jun 2019 09:42:34 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 It turned out qualify_lookup was rejecting non-decls, and hence the ordering of that call relative to other tests was significant. I've restored the relative ordering to that prior to my reimplementation of lookup_type_scope_1. applying to trunk. nathan 2019-06-17 Nathan Sidwell PR c++/90754 * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before checking context. PR c++/90754 * g++.dg/lookup/pr90754.C: New. Index: gcc/cp/name-lookup.c =================================================================== --- gcc/cp/name-lookup.c (revision 272381) +++ gcc/cp/name-lookup.c (working copy) @@ -6488,13 +6488,13 @@ lookup_type_scope_1 (tree name, tag_scop correctly. */ if (tree type = iter->type) - if ((scope != ts_current - || LOCAL_BINDING_P (iter) - || DECL_CONTEXT (type) == iter->scope->this_entity) - && qualify_lookup (iter->type, LOOKUP_PREFER_TYPES)) - return iter->type; + if (qualify_lookup (type, LOOKUP_PREFER_TYPES) + && (scope != ts_current + || LOCAL_BINDING_P (iter) + || DECL_CONTEXT (type) == iter->scope->this_entity)) + return type; - if ((scope != ts_current - || !INHERITED_VALUE_BINDING_P (iter)) - && qualify_lookup (iter->value, LOOKUP_PREFER_TYPES)) + if (qualify_lookup (iter->value, LOOKUP_PREFER_TYPES) + && (scope != ts_current + || !INHERITED_VALUE_BINDING_P (iter))) return iter->value; } Index: gcc/testsuite/g++.dg/lookup/pr90754.C =================================================================== --- gcc/testsuite/g++.dg/lookup/pr90754.C (revision 0) +++ gcc/testsuite/g++.dg/lookup/pr90754.C (working copy) @@ -0,0 +1,11 @@ +// PR c++/90754 ICE in type lookup. + +class A { + struct COMTypeInfo; +}; +class B { + struct COMTypeInfo; +}; +class C : A, B { + struct COMTypeInfo; +};