public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10449: Totally bogus error message on missing typename (GCC 3.4)
@ 2003-04-22  1:16 giovannibajo
  0 siblings, 0 replies; only message in thread
From: giovannibajo @ 2003-04-22  1:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10449
>Category:       c++
>Synopsis:       Totally bogus error message on missing typename (GCC 3.4)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 22 01:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Giovanni Bajo
>Release:        g++-3.4 (GCC) 3.4 20030413 (experimental)
>Organization:
>Environment:
cygwin
>Description:
The following legal code gives a totally bogus error message on mainline:

------------------------------
struct Foo
{};

template <typename T>
struct Identity
{
    typedef T type;
};

struct Bar
{
    template <typename T>
    typename Identity<T>::type
    func(T t)
    {
        return Identity<T>::type(t);
    }
};

int main()
{
    Bar b;

    b.func(Foo());
}
------------------------------
gcc34bug1.cpp: In member function `typename Identity<T>::type Bar::func(T)   [with T = Foo]':
gcc34bug1.cpp:24:   instantiated from here
gcc34bug1.cpp:16: error: no match for call to `(Foo) (Foo&)'

The problem in the above code is that line 16 is missing the typename keyword.

This is obviously not reproducible on 3.3 or previous due to the implicit typename extensions. 
>How-To-Repeat:
Compile the above file on 3.4
>Fix:

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-22  1:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-22  1:16 c++/10449: Totally bogus error message on missing typename (GCC 3.4) giovannibajo

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