From patchwork Sat Mar 2 11:21:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 224482 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 CE6DD2C02F5 for ; Sat, 2 Mar 2013 22:21:31 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1362828093; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=XvihCDdiFEBTU2BWDHINtQqkEII=; b=bkJtLgkCp6BLsVw HvglR9fdAHQYI96DhoaGHL+/NTem+j3vleJvGODazWM8/wtUynDpIZ79zt7bbYUI fL3VCJPa46AnOoLWSJKQbjFMb2Ftg2OgQHWNqICHap8GKUHxj1jGcDAQLxk1IriO LDdq3MrPHpDbewo18HDONAK7F0uY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=QWCkuP1KwyYdDvsTVQ/PtEi/fl2ftewSR86ipoduSkzhHW+MjeZHRLnkFznO9P 3SD5NifKuazjg24jd6C9ohz1g86lRDwsrA9wO0rxdnog16ALAs/dBeeIgxz4pyTd NpC1e2nnh/Mi3P6uvV1KtmwzthSpoLMWmNEaMQvDn3SHA=; Received: (qmail 18154 invoked by alias); 2 Mar 2013 11:21:27 -0000 Received: (qmail 18146 invoked by uid 22791); 2 Mar 2013 11:21:26 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL, BAYES_00, FSL_NEW_HELO_USER, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Mar 2013 11:21:22 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r22BLLGu007164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 2 Mar 2013 11:21:21 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r22BLKeI017518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 2 Mar 2013 11:21:21 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r22BLKDc003562 for ; Sat, 2 Mar 2013 05:21:20 -0600 Received: from [192.168.1.4] (/79.47.194.171) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 02 Mar 2013 03:21:20 -0800 Message-ID: <5131E0AE.5080403@oracle.com> Date: Sat, 02 Mar 2013 12:21:18 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [C++ testcases, committed] PR 10291, PR 52688 X-IsSubscribed: yes 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 Hi, I added some testcases and closed the PRs as fixed for 4.8.0. Thanks, Paolo. //////////////////// 2013-03-02 Paolo Carlini PR c++/52688 * g++.dg/template/static33.C: New. * g++.dg/template/static34.C: Likewise. PR c++/10291 * g++.dg/template/static35.C: New. Index: g++.dg/template/static33.C =================================================================== --- g++.dg/template/static33.C (revision 0) +++ g++.dg/template/static33.C (working copy) @@ -0,0 +1,18 @@ +// PR c++/52688 +// { dg-do link } + +template +T f() +{ + static const double staticLocalVariable = 100.0; + struct local + { + static double f() { return staticLocalVariable; } + }; + return T(local::f()); +} + +int main() +{ + f(); +} Index: g++.dg/template/static34.C =================================================================== --- g++.dg/template/static34.C (revision 0) +++ g++.dg/template/static34.C (working copy) @@ -0,0 +1,21 @@ +// PR c++/52688 +// { dg-do link } + +template +struct A { + static bool test() { + static bool value = false; + if (value) + return false; + struct S { + S() { value = true; } + }; + static S s; + return true; + } +}; + +int main() +{ + A::test(); +} Index: g++.dg/template/static35.C =================================================================== --- g++.dg/template/static35.C (revision 0) +++ g++.dg/template/static35.C (working copy) @@ -0,0 +1,21 @@ +// PR c++/10291 +// { dg-do link } + +template +int foo () +{ + static int i; + + struct S { + int bar () { + return i; + } + } s; + + return s.bar (); +} + +int main () +{ + foo(); +}