From patchwork Fri Nov 5 05:55:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 70243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C806D1007D2 for ; Fri, 5 Nov 2010 16:55:36 +1100 (EST) Received: (qmail 15103 invoked by alias); 5 Nov 2010 05:55:32 -0000 Received: (qmail 15094 invoked by uid 22791); 5 Nov 2010 05:55:30 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Nov 2010 05:55:25 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA55tNmn031606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 5 Nov 2010 01:55:23 -0400 Received: from [127.0.0.1] ([10.3.113.16]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA55tNPa002809 for ; Fri, 5 Nov 2010 01:55:23 -0400 Message-ID: <4CD39C4A.3060403@redhat.com> Date: Fri, 05 Nov 2010 01:55:22 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101031 Lightning/1.0b1 Shredder/3.0.11pre MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/46304 (ICE with COMPLEX_CST in template) 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 My recent rework of tsubst_copy needed to include COMPLEX_CST. Tested x86_64-pc-linux-gnu, applied to trunk. commit f002d2b948e858357d3bb5083359a9b73413ab90 Author: Jason Merrill Date: Fri Nov 5 01:12:17 2010 -0400 PR c++/46304 * pt.c (tsubst_copy): Handle COMPLEX_CST. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ca2baeb..ed04b2b 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11658,6 +11658,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) case INTEGER_CST: case REAL_CST: case STRING_CST: + case COMPLEX_CST: { /* Instantiate any typedefs in the type. */ tree type = tsubst (TREE_TYPE (t), args, complain, in_decl); diff --git a/gcc/testsuite/g++.dg/ext/complex6.C b/gcc/testsuite/g++.dg/ext/complex6.C new file mode 100644 index 0000000..9a7c50a --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/complex6.C @@ -0,0 +1,10 @@ +// PR c++/46304 +// { dg-options "" } + +template +void f() +{ + __complex double d = 1.0 + 2.0i; +} + +template void f();