public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53102] New: Misplaced 'typename' gives access to private type
@ 2012-04-24 11:08 kristian.spangsege at gmail dot com
  2012-04-24 11:27 ` [Bug c++/53102] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kristian.spangsege at gmail dot com @ 2012-04-24 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53102
           Summary: Misplaced 'typename' gives access to private type
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kristian.spangsege@gmail.com


Here 'typename' is used outside a template, in which case it apparently
invalidly gives access to A::type.


class A {
private:
  typedef int type;
};

class B {
public:
  typedef typename A::type type;
};


int main()
{
  B::type v = 8;
  return v;
}


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

* [Bug c++/53102] Misplaced 'typename' gives access to private type
  2012-04-24 11:08 [Bug c++/53102] New: Misplaced 'typename' gives access to private type kristian.spangsege at gmail dot com
@ 2012-04-24 11:27 ` redi at gcc dot gnu.org
  2012-04-24 16:19 ` pinskia at gcc dot gnu.org
  2020-03-12 18:27 ` [Bug c++/53102] typename " mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2012-04-24 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-04-24
     Ever Confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-24 11:26:58 UTC ---
4.4 rejects it with:
t.cc:8: error: using 'typename' outside of template

But later releases silently accept it in c++98 or c++11 mode

(N.B. using 'typenme' outside of templates is valid in C++11)


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

* [Bug c++/53102] Misplaced 'typename' gives access to private type
  2012-04-24 11:08 [Bug c++/53102] New: Misplaced 'typename' gives access to private type kristian.spangsege at gmail dot com
  2012-04-24 11:27 ` [Bug c++/53102] " redi at gcc dot gnu.org
@ 2012-04-24 16:19 ` pinskia at gcc dot gnu.org
  2020-03-12 18:27 ` [Bug c++/53102] typename " mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-04-24 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-24 16:19:38 UTC ---
>(N.B. using 'typenme' outside of templates is valid in C++11)

That was a Defect report.  
I think my patch to fix PR22154 was not a complete one.


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

* [Bug c++/53102] typename gives access to private type
  2012-04-24 11:08 [Bug c++/53102] New: Misplaced 'typename' gives access to private type kristian.spangsege at gmail dot com
  2012-04-24 11:27 ` [Bug c++/53102] " redi at gcc dot gnu.org
  2012-04-24 16:19 ` pinskia at gcc dot gnu.org
@ 2020-03-12 18:27 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-03-12 18:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53102

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in GCC 4.8.1, likely by
r0-117899-g0e69fdf016311cb8570c43d8ec67e9d5cb2f2aeb.

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

end of thread, other threads:[~2020-03-12 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-24 11:08 [Bug c++/53102] New: Misplaced 'typename' gives access to private type kristian.spangsege at gmail dot com
2012-04-24 11:27 ` [Bug c++/53102] " redi at gcc dot gnu.org
2012-04-24 16:19 ` pinskia at gcc dot gnu.org
2020-03-12 18:27 ` [Bug c++/53102] typename " mpolacek at gcc dot gnu.org

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