public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/6079: Access error message discrepancy between template & plain class
@ 2002-09-15 11:36 nathan
  0 siblings, 0 replies; 3+ messages in thread
From: nathan @ 2002-09-15 11:36 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jdonner, nobody

Synopsis: Access error message discrepancy between template & plain class

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 11:36:07 2002
State-Changed-Why:
    confirmed, current CVS ICE's
    I have attached a more straight forward test case

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6079


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

* Re: c++/6079: Access error message discrepancy between template & plain class
@ 2003-01-22 21:24 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-01-22 21:24 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jdonner, nobody

Synopsis: Access error message discrepancy between template & plain class

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Wed Jan 22 21:24:39 2003
State-Changed-Why:
    Fixed on 3.4 mainline.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6079


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

* c++/6079: Access error message discrepancy between template & plain class
@ 2002-03-27 20:46 jdonner
  0 siblings, 0 replies; 3+ messages in thread
From: jdonner @ 2002-03-27 20:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6079
>Category:       c++
>Synopsis:       Access error message discrepancy between template & plain class
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 27 20:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     JDonner
>Release:        gcc 3.0.4
>Organization:
>Environment:
Reading specs from /usr/local/gcc304/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/specs
Configured with: /home/jdonner/mk304/gcc-3.0.4/configure --prefix=/usr/local/gcc304 --enable-threads
Thread model: posix
gcc version 3.0.4
>Description:
In some circumstances g++ doesn't warn about a hidden type as directly as in others.

// badtypedef.cpp
#if defined(CASE1)
#   define TMPL_ERR_MSG
#elif defined(CASE2)
#   define TMPL_ERR_MSG
#   define TMPL_ERR_HELPER
#endif
struct Highup{Highup() {}};

class Base : public Highup {
  typedef Highup Inherited;
  struct Secret{};
public:
  Base() : Inherited() {}
};

#ifdef TMPL_ERR_MSG
template <class SomeT>
#endif
struct Derived : public Base {
  Derived(int x) : Inherited() {
#ifdef TMPL_ERR_HELPER
  Secret s;
#endif
}
};

int main() { Derived<int> d(3); }
///////////////////////////////////////

-- Normal case;

jdonner@deathstar ~> g++ badtypedef.cpp
badtypedef.cpp: In constructor `Derived::Derived(int)':
badtypedef.cpp:11: `typedef struct Highup Base::Inherited' is private
badtypedef.cpp:21: within this context


-- Making Derived a template, g++ no longer says explicitly that 
-- 'Inherited' is private;

jdonner@deathstar ~> g++ -DCASE1 badtypedef.cpp
badtypedef.cpp: In constructor `Derived<SomeT>::Derived(int) [with SomeT = int]':
badtypedef.cpp:28:   instantiated from here
badtypedef.cpp:21: `Highup' is not an immediate base class of `Derived<int>'


-- But referring to another hidden type restores the message about 'Inherited'.

jdonner@deathstar ~> g++ -DCASE2 badtypedef.cpp
badtypedef.cpp: In constructor `Derived<SomeT>::Derived(int)':
badtypedef.cpp:12: `struct Base::Secret' is private
badtypedef.cpp:23: within this context
badtypedef.cpp:11: `typedef struct Highup Base::Inherited' is private
badtypedef.cpp:23: within this context
badtypedef.cpp: In constructor `Derived<SomeT>::Derived(int) [with SomeT = int]':
badtypedef.cpp:28:   instantiated from here
badtypedef.cpp:21: `Highup' is not an immediate base class of `Derived<int>'


g++ 2.95 does the same thing except CASE2 is no different from CASE1.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-01-22 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-15 11:36 c++/6079: Access error message discrepancy between template & plain class nathan
  -- strict thread matches above, loose matches on Subject: below --
2003-01-22 21:24 bangerth
2002-03-27 20:46 jdonner

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