From patchwork Tue Oct 25 07:07:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roberto Agostino Vitillo X-Patchwork-Id: 121501 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 3822D1007D9 for ; Tue, 25 Oct 2011 18:07:29 +1100 (EST) Received: (qmail 12202 invoked by alias); 25 Oct 2011 07:07:25 -0000 Received: (qmail 12191 invoked by uid 22791); 25 Oct 2011 07:07:22 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ironport4.lbl.gov (HELO ironport4.lbl.gov) (128.3.41.45) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 07:07:09 +0000 X-Ironport-SBRS: 4.4 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlEBANRfpk5KfVIukGdsb2JhbABDqREIIgEBAQEJCQ0HFAQhgW4BAQEBAxICZRALRjQBBQEcBjWHYJcrCp0ah2JhBJk1iAU9g3E Received: from mail-ww0-f46.google.com ([74.125.82.46]) by ironport4.lbl.gov with ESMTP; 25 Oct 2011 00:07:08 -0700 Received: by wwp14 with SMTP id 14so152196wwp.27 for ; Tue, 25 Oct 2011 00:07:07 -0700 (PDT) Received: by 10.227.208.81 with SMTP id gb17mr1750433wbb.24.1319526427561; Tue, 25 Oct 2011 00:07:07 -0700 (PDT) Received: from [192.168.1.28] (224.17.98.84.rev.sfr.net. [84.98.17.224]) by mx.google.com with ESMTPS id o17sm41409301wbm.6.2011.10.25.00.07.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Oct 2011 00:07:06 -0700 (PDT) Subject: Re: [C++ Patch] PR 30066 Mime-Version: 1.0 (Apple Message framework v1251.1) From: Roberto Agostino Vitillo In-Reply-To: <9626C619-F208-41A6-9FBC-988C3F9CBA8C@lbl.gov> Date: Tue, 25 Oct 2011 09:07:03 +0200 Cc: gcc-patches@gcc.gnu.org, Paolo Carlini , Vincenzo Innocente Message-Id: <49A56898-F089-438B-ADAC-541095E8A322@lbl.gov> References: <1F1A5107-8C1D-411E-9048-EECA2EE3764E@lbl.gov> <4EA17EB9.3050405@redhat.com> <9626C619-F208-41A6-9FBC-988C3F9CBA8C@lbl.gov> To: Jason Merrill 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 The new testcase: Index: gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-4.C =================================================================== --- gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-4.C (revision 0) +++ gcc/testsuite/g++.dg/ext/visibility/fvisibility-inlines-hidden-4.C (revision 0) @@ -0,0 +1,37 @@ +/* PR c++/30066: Test that -fvisibility-inlines-hidden affects functions. */ +/* { dg-do compile } */ +/* { dg-require-visibility "" } */ +/* { dg-options "-fvisibility-inlines-hidden" } */ +/* { dg-final { scan-hidden "_Z3barv" } } */ +/* { dg-final { scan-not-hidden "_ZZ3barvE1n" } } */ +/* { dg-final { scan-not-hidden "_Z3fooIiEvv" } } */ +/* { dg-final { scan-hidden "_Z3fooIvEvv" } } */ +/* { dg-final { scan-hidden "_ZZN1A5innerEvE1n" } } */ + +inline int * bar() +{ + static int n; + return &n; +} + +template +inline void foo() { } + +template void foo(); + +namespace A __attribute__ ((visibility ("hidden"))) +{ + inline int * inner() + { + static int n; + return &n; + } +} + +int main(void) +{ + bar(); + foo(); + A::inner(); + return 0; +}