public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8622: typename of base class
@ 2002-11-22 22:36 laurent
  0 siblings, 0 replies; 4+ messages in thread
From: laurent @ 2002-11-22 22:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8622
>Category:       c++
>Synopsis:       typename of base class
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 18 08:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     laurent@ient.rwth-aachen.de
>Release:        gcc3.2
>Organization:
>Environment:
cygwin, probably every other
>Description:
A type definition, defined by a template typename in a base class, is not understood in the derived class.
This work with Visual 7 or Intel Compiler 6, but gcc gives the following unjustified warnings:

warnings: 'typename B<V>::value_type' is implicitly a typename
warnings: implicit typename is deprecated, please see the documentation for details

Am I wrong ?
If it is really a bug, please correct it, because it is quite important for my big project.

Patrick
>How-To-Repeat:
template<class V>
struct value_traits
{
  typedef V value_type;
};


template<class V>
struct A
{
  typedef typename value_traits<V>::value_type value_type;
};

template<class V>
struct B : public A<V>
{
  value_type v;
};

int main()
{
  B<int> b;
  return 0;
}
>Fix:

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


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

* Re: c++/8622: typename of base class
@ 2002-11-26  5:56 Gabriel Dos Reis
  0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Dos Reis @ 2002-11-26  5:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/8622; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: "Patrick Laurent" <laurent@ient.rwth-aachen.de>
Cc: <reichelt@igpm.rwth-aachen.de>, gcc-gnats@gcc.gnu.org
Subject: Re: c++/8622: typename of base class
Date: 19 Nov 2002 16:59:58 +0100

 "Patrick Laurent" <laurent@ient.rwth-aachen.de> writes:
 
 | Hello
 | 
 | Thank you very much for your two quick answers
 | 
 | But I have to admit that I am still not convinced that gcc 3.2 is doing
 | right with the typedef in a base class.
 
 Well, that is a differenr matter ;-)  GCC is behaving as required by the
 standard (actually it should give an error to make it non-negociable :-)
 
 | Please, I would like to know if there is a reason to this gcc property.
 
 standard requirement.
 
 | -I know that VC7 is quiet not the best compiler (It can't even undestand
 | Partial Template Specialisations), but this can't be an argument.
 
 I can't find anyone bringing up that argument; what did you mean?
 
 |  In fact I
 | don't use VC7, but Intel Compiler 6 and gcc2.9.5.
 | 
 | -It is perhaps deprecated yet, but it used to work with gcc2.9.5
 
 GCC-2.95 was non conformant.
 
 | -I fand the "workarround" you mentionned but then the class hierarchy
 | doesn't make sense any more.
 
 Huh?
 
 | The "workarround" consists in making a new typedef in the derived class:
 |   template <class V> struct B : public A<V> { typedef typename
 | A<V>::value_type value_type; ...}
 
 Yes.
 
 | -Is my use of several STL-structures not right any more? for exemple:
 | 
 |   #include <functional>
 |   using namespace std;
 | 
 |   template<class T>
 |   struct id_function : public unary_function<T,T>
 |   {
 |     result_type operator()(const argument_type &x) const { return x; }
 
 Yes this is an error as the base class (a dependent type) is not or
 should not be examinated in the template definition.  Yes, that may
 make the whole  (unary|binary)_function<> thingies pointless.
 
 -- Gaby


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

* Re: c++/8622: typename of base class
@ 2002-11-23  0:11 Gabriel Dos Reis
  0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Dos Reis @ 2002-11-23  0:11 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/8622; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: laurent@ient.rwth-aachen.de
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/8622: typename of base class
Date: 18 Nov 2002 17:47:15 +0100

 laurent@ient.rwth-aachen.de writes:
 
 [...]
 
 | >Class:          sw-bug
 
 this is not a bug.
 
 [...]
 
 | >Description:
 | A type definition, defined by a template typename in a base class, is not understood in the derived class.
 | This work with Visual 7 or Intel Compiler 6, but gcc gives the following unjustified warnings:
 
 GCC's behaviour is correct. VC7 is bogus.
 
 -- Gaby


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

* Re: c++/8622: typename of base class
@ 2002-11-23  0:06 gdr
  0 siblings, 0 replies; 4+ messages in thread
From: gdr @ 2002-11-23  0:06 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, laurent, nobody

Synopsis: typename of base class

State-Changed-From-To: open->closed
State-Changed-By: gdr
State-Changed-When: Mon Nov 18 08:55:11 2002
State-Changed-Why:
    Not a bug.

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


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-22 22:36 c++/8622: typename of base class laurent
2002-11-23  0:06 gdr
2002-11-23  0:11 Gabriel Dos Reis
2002-11-26  5:56 Gabriel Dos Reis

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