public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id
@ 2004-07-18 13:52 lerdsuwa at gcc dot gnu dot org
  2004-07-18 19:46 ` [Bug c++/16617] " giovannibajo at libero dot it
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-07-18 13:52 UTC (permalink / raw)
  To: gcc-bugs

This is a spin out of a problem mentioned in PR13092.
The following testcase shouldn't compile because only
fr<int> is friend of class D.  But we are accessing
protected members from fr<char>.  GCC 3.4, 3.5 fail
to diagnose it.  Earlier GCC don't handle this properly
(checking access while parsing the template fr<T> which
is too early.)  So it's not a regression.


// Two-phase name lookup for address of member:
// Protected member access

class B
{
  protected:
  int i;			// { dg-error "protected" }
};

template <class T> void fr ();

class D2 : public B
{
  friend void fr<int> ();
};

template<int B::*> struct X
{};

template <class T> void fr ()
{
  X<&B::i> x1;			// { dg-error "context" }
  X<&D2::i> x2;			// { dg-error "context" }
}

template void fr<char>();	// { dg-error "instantiated" }

-- 
           Summary: Fail to do access checking correctly for non-dependent
                    qualified-id
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lerdsuwa at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
@ 2004-07-18 19:46 ` giovannibajo at libero dot it
  2004-07-28 13:48 ` bangerth at dealii dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-18 19:46 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
  2004-07-18 19:46 ` [Bug c++/16617] " giovannibajo at libero dot it
@ 2004-07-28 13:48 ` bangerth at dealii dot org
  2004-12-12 12:42 ` lerdsuwa at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-07-28 13:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-28 13:48 -------
Confirmed. 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-28 13:48:57
               date|                            |


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
  2004-07-18 19:46 ` [Bug c++/16617] " giovannibajo at libero dot it
  2004-07-28 13:48 ` bangerth at dealii dot org
@ 2004-12-12 12:42 ` lerdsuwa at gcc dot gnu dot org
  2005-01-12 10:50 ` lerdsuwa at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-12-12 12:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2004-12-12 12:42 -------
Got it.  The target for this fix is GCC 4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |lerdsuwa at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-12-12 12:42 ` lerdsuwa at gcc dot gnu dot org
@ 2005-01-12 10:50 ` lerdsuwa at gcc dot gnu dot org
  2005-04-23 15:30 ` lerdsuwa at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-01-12 10:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-01-12 10:50 -------
May be fixed together with PR19311.

-- 


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-01-12 10:50 ` lerdsuwa at gcc dot gnu dot org
@ 2005-04-23 15:30 ` lerdsuwa at gcc dot gnu dot org
  2005-05-19 17:09 ` lerdsuwa at gcc dot gnu dot org
  2005-06-07 14:59 ` lerdsuwa at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-04-23 15:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-04-23 15:30 -------
This is a stage 2 project.  Likely to be fixed in a month or two.

-- 


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-04-23 15:30 ` lerdsuwa at gcc dot gnu dot org
@ 2005-05-19 17:09 ` lerdsuwa at gcc dot gnu dot org
  2005-06-07 14:59 ` lerdsuwa at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-05-19 17:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-05-19 17:09 -------
Patch using new approach for 4.1:
  http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01992.html
(Note this is part 4 in a series, earlier parts are also required)


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |05/msg01992.html
           Keywords|                            |patch


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


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

* [Bug c++/16617] Fail to do access checking correctly for non-dependent qualified-id
  2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-05-19 17:09 ` lerdsuwa at gcc dot gnu dot org
@ 2005-06-07 14:59 ` lerdsuwa at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2005-06-07 14:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-06-07 14:58 -------
Patch withdrawn due to overlooking default function argument and default
template argument. No nice solution is found yet.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|lerdsuwa at gcc dot gnu dot |unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW
           Keywords|patch                       |


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


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

end of thread, other threads:[~2005-06-07 14:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-18 13:52 [Bug c++/16617] New: Fail to do access checking correctly for non-dependent qualified-id lerdsuwa at gcc dot gnu dot org
2004-07-18 19:46 ` [Bug c++/16617] " giovannibajo at libero dot it
2004-07-28 13:48 ` bangerth at dealii dot org
2004-12-12 12:42 ` lerdsuwa at gcc dot gnu dot org
2005-01-12 10:50 ` lerdsuwa at gcc dot gnu dot org
2005-04-23 15:30 ` lerdsuwa at gcc dot gnu dot org
2005-05-19 17:09 ` lerdsuwa at gcc dot gnu dot org
2005-06-07 14:59 ` lerdsuwa at gcc dot gnu dot 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).