public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5577: Parse error (both mainline and newparser)
@ 2002-02-01 16:26 pcarlini
  0 siblings, 0 replies; 2+ messages in thread
From: pcarlini @ 2002-02-01 16:26 UTC (permalink / raw)
  To: gcc-gnats; +Cc: nbecker


>Number:         5577
>Category:       c++
>Synopsis:       Parse error (both mainline and newparser)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 01 16:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Paolo Carlini / Neal D. Becker
>Release:        3.1 20020201 &  current newparser branch
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The following code snippet triggers a parse error @line 26:
////////
template<typename coeftype>
struct IIR {
  IIR () {}
  template <class outputtype>
  outputtype Compute (coeftype x) {
    return outputtype();
  }
};

// This is Ok.
IIR<double> iir;
double out_iir = iir.Compute<double>(0.0);

// This is Ok.
struct JTC_fading2 {
  void Iterate () {
    double out_iir = iir.Compute<double>(0.0);
  }
  IIR<double> iir;
};

// This is NOT Ok.
template<typename rng_t>
struct JTC_fading {
  void Iterate () {
    double out_iir = iir.Compute<double>(0.0); // <- Error
  }
  IIR<double> iir;
};
//////////
>How-To-Repeat:
EDG-based C++ compiler have no problem with it.
>Fix:

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


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

* Re: c++/5577: Parse error (both mainline and newparser)
@ 2002-02-01 16:42 paolo
  0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2002-02-01 16:42 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nbecker, nobody, paolo, pcarlini

Synopsis: Parse error (both mainline and newparser)

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Fri Feb  1 16:42:46 2002
Responsible-Changed-Why:
    (further) analyzed.
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Fri Feb  1 16:42:46 2002
State-Changed-Why:
    Sorry. This is in fact a well known problem
    (duplicate of c++/4862, f.i.)
    The workaround is adding the template keyword like this:
    double out_iir = iir.template Compute<double>(0.0);
    
    Cheers, Paolo.

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


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

end of thread, other threads:[~2002-02-02  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 16:26 c++/5577: Parse error (both mainline and newparser) pcarlini
2002-02-01 16:42 paolo

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