public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8961: template template parameter works with 2.95; 3.2.1 reports error.
@ 2002-12-16  8:33 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-16  8:33 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, helm, nobody

Synopsis: template template parameter works with 2.95; 3.2.1 reports error.

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 16 08:33:50 2002
State-Changed-Why:
    When you write in your partial specialization
    template<int rows>
    struct Matrix<rows,1> : Matrix_Base<rows,1,Matrix> {
        Matrix() : Matrix_Base<rows,1,Matrix>() {};
                                      ^^^^^^
    The unqualified use of "Matrix" in the template list of the
    base class initializer refers to the present class (with
    all template arguments (just in the same way as you write
    the name of the constructor as Matrix instead of
    Matrix<rows,1>. If you want to refer to the global
    template (without fixed template arguments), then you
    have to write ::Matrix, which makes your code compile.
    
    By the way, writing
    template<int rows, int cols, template<int rows, int cols> class C>
    is asking for trouble, since you use the same identifier
    names (rows, cols) twice. Use different names, or omit
    them in the template template parameter at all.
    
    W.

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


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

* c++/8961: template template parameter works with 2.95; 3.2.1 reports error.
@ 2002-12-16  7:16 helm
  0 siblings, 0 replies; 2+ messages in thread
From: helm @ 2002-12-16  7:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8961
>Category:       c++
>Synopsis:       template template parameter works with 2.95; 3.2.1 reports error.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 16 07:16:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Helm
>Release:        gcc version 3.2.1 20020924 (Debian prerelease)
>Organization:
>Environment:

>Description:
g++ (3.2.1) rejects the attached code with:
test2.cc: In constructor `Matrix<rows, 1>::Matrix()':
test2.cc:29: type/value mismatch at argument 3 in template parameter list for `
   template<int rows, int cols, template<int rows, int cols> class C> class 
   Matrix_Base'
test2.cc:29:   expected a class template, got `Matrix<rows, 1>'
test2.cc:29: class `Matrix<rows, 1>' does not have any field named `
   <declaration error>'

g++ (2.95 and 3.0.4) does fine
>How-To-Repeat:
Try to compile the attached code using g++ (3.2.1)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="test2.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test2.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlPGludCBy
b3dzLCBpbnQgY29scywgdGVtcGxhdGU8aW50IHJvd3MsIGludCBjb2xzPiBjbGFzcyBDPgoJY2xh
c3MgTWF0cml4X0Jhc2UgewoJCXB1YmxpYzoKCQkJTWF0cml4X0Jhc2UoKSB7CgkJCQljb3V0IDw8
IF9fUFJFVFRZX0ZVTkNUSU9OX18gPDwgZW5kbDsKCQkJfTsKCQkJdGVtcGxhdGU8aW50IGNvbHMy
PgoJCQkJQzxyb3dzLGNvbHMyPiogb3BlcmF0b3IqKEM8Y29scyxjb2xzMj4mIGxocykgewoJCQkJ
CXJldHVybiAwOwoJCQkJfQoJfTsKCnRlbXBsYXRlPGludCByb3dzLCBpbnQgY29scz4KCWNsYXNz
IE1hdHJpeCA6IHB1YmxpYyBNYXRyaXhfQmFzZTxyb3dzLGNvbHMsTWF0cml4PiB7CgkJcHVibGlj
OgoJCQlNYXRyaXgoKSA6IE1hdHJpeF9CYXNlPHJvd3MsY29scyxNYXRyaXg+KCkgewoJCQkJY291
dCA8PCBfX1BSRVRUWV9GVU5DVElPTl9fIDw8IGVuZGw7CgkJCX07Cgl9OwoKLy90ZW1wbGF0ZTxp
bnQgeCxpbnQgeSx0ZW1wbGF0ZTxpbnQsaW50PiBjbGFzcyBDLCBpbnQgXzIsaW50IF8xID4gY2xh
c3MgTWF0cml4X0Jhc2U8eCx5LEM8XzEsXzI+ID46IHB1YmxpYyBNYXRyaXhfQmFzZTx4LHksQz4g
e307CnRlbXBsYXRlPGludCByb3dzPgoJY2xhc3MgTWF0cml4PHJvd3MsMT4gOiBwdWJsaWMgTWF0
cml4X0Jhc2U8cm93cywxLE1hdHJpeD4gewoJCXB1YmxpYzoKCQkJTWF0cml4KCkgOiBNYXRyaXhf
QmFzZTxyb3dzLDEsTWF0cml4PigpIHsKCQkJCWNvdXQgPDwgX19QUkVUVFlfRlVOQ1RJT05fXyA8
PCBlbmRsOwoJCQl9OwoJfTsKCmludCBtYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpIHsKCU1h
dHJpeDwyLDI+IEE7CglNYXRyaXg8MiwxPiBCOwoKCUEqQTsKfQo=


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

end of thread, other threads:[~2002-12-16 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-16  8:33 c++/8961: template template parameter works with 2.95; 3.2.1 reports error bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-12-16  7:16 helm

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