public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: mueller@kde.org
To: gcc-gnats@gcc.gnu.org
Subject: middle-end/9332: __attribute__ ((visibility("hidden")) should apply to classes
Date: Wed, 15 Jan 2003 19:06:00 -0000	[thread overview]
Message-ID: <20030115190014.438C43947DF@bembel.homeip.net> (raw)


>Number:         9332
>Category:       middle-end
>Synopsis:       __attribute__ ((visibility("hidden")) should apply to classes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 15 11:06:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Dirk Mueller
>Release:        3.3
>Organization:
KDE
>Environment:
System: Linux matrix 2.4.19-4GB #1 Thu Nov 14 09:55:36 UTC 2002 i686 unknown
Architecture: i686

host: i486-suse-linux-gnu
build: i486-suse-linux-gnu
target: i486-suse-linux-gnu
configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
>Description:

gcc should allow to apply the visibility attribute to classes and other complex
types. It should behave as if the visibility attribute was specified on each member
function and variable, unless one of them "overwrites" the setting by specifying a custom
visibility. 

This feature is necessary to easily control the amount of exported symbols in bigger
C/C++ projects. 

>How-To-Repeat:

try to compile this example file: 

#include <stdio.h>

class __attribute__( ( visibility( "hidden" ) ) ) MyClass
{
public:
    MyClass();

    static int member;
};

int MyClass::member;

MyClass::MyClass()
{ }

int main()
{
    MyClass f;
    printf( "%d",MyClass::member );
    return 0;
}

#g++ -Wall test.cc
test.cc:9: warning: `visibility' attribute does not apply to types


>Fix:
  see above. 
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-01-15 19:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-15 19:06 mueller [this message]
2003-01-22 21:16 Dirk Mueller
2003-01-22 23:33 ehrhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030115190014.438C43947DF@bembel.homeip.net \
    --to=mueller@kde.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).