public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56248] New: [DR 580] access checking of template parameters done too early
@ 2013-02-07 23:34 redi at gcc dot gnu.org
  2024-04-04  6:22 ` [Bug c++/56248] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2013-02-07 23:34 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56248
           Summary: [DR 580] access checking of template parameters done
                    too early
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


This code based on the example in [class.access]/6 is rejected:

class A {
  typedef int I; // private member
  template<int> struct Q;
  template<int> friend struct R;
protected:
  struct B { };
};
template<A::I> struct A::Q { };
template<A::I> struct R { };
struct D: A::B, A { };


t.cc:2:15: error: ‘typedef int A::I’ is private
   typedef int I; // private member
               ^
t.cc:8:13: error: within this context
 template<A::I> struct A::Q { };
             ^
t.cc:2:15: error: ‘typedef int A::I’ is private
   typedef int I; // private member
               ^
t.cc:9:13: error: within this context
 template<A::I> struct R { };
             ^
t.cc:6:10: error: ‘struct A::B’ is protected
   struct B { };
          ^
t.cc:10:14: error: within this context
 struct D: A::B, A { };
              ^

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#580 clarifies that
access checking of the template parameters should be delayed until the context
is known.


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

* [Bug c++/56248] [DR 580] access checking of template parameters done too early
  2013-02-07 23:34 [Bug c++/56248] New: [DR 580] access checking of template parameters done too early redi at gcc dot gnu.org
@ 2024-04-04  6:22 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04  6:22 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jlame646 at gmail dot com

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 111872 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2024-04-04  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 23:34 [Bug c++/56248] New: [DR 580] access checking of template parameters done too early redi at gcc dot gnu.org
2024-04-04  6:22 ` [Bug c++/56248] " pinskia 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).