public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59191] New: Accessibility of types not checked in template functions
@ 2013-11-19 15:44 akim.demaille at gmail dot com
  2013-11-19 16:28 ` [Bug c++/59191] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: akim.demaille at gmail dot com @ 2013-11-19 15:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59191

            Bug ID: 59191
           Summary: Accessibility of types not checked in template
                    functions
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: akim.demaille at gmail dot com

Hi all,

Below, GCC forgets to check the accessibility of "type", which
turns out to be private:

$ cat foo.cc
class foo
{
  typedef int type;
};

template <typename T>
foo::type bar()
{
  return 1;
}

int main()
{
  return bar<char>();
}
$ g++-mp-4.9 -Wall foo.cc
$ clang++-mp-3.1 -Wall foo.cc
foo.cc:7:6: error: 'type' is a private member of 'foo'
foo::type bar()
     ^
foo.cc:3:15: note: implicitly declared private here
  typedef int type;
              ^
1 error generated.


All the GCCs I have access to (4.4 .. 4.9) exhibit the same behavior.

Cheers!


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/59191] Accessibility of types not checked in template functions
  2013-11-19 15:44 [Bug c++/59191] New: Accessibility of types not checked in template functions akim.demaille at gmail dot com
@ 2013-11-19 16:28 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-19 16:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59191

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup.

*** This bug has been marked as a duplicate of bug 47346 ***


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-19 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 15:44 [Bug c++/59191] New: Accessibility of types not checked in template functions akim.demaille at gmail dot com
2013-11-19 16:28 ` [Bug c++/59191] " paolo.carlini at oracle dot com

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).