This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/7319: misleading template in error message
- From: nathan at codesourcery dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 15 Jul 2002 21:18:25 -0000
- Subject: c++/7319: misleading template in error message
- Reply-to: nathan at codesourcery dot com
>Number: 7319
>Category: c++
>Synopsis: misleading template in error message
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 15 14:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: nathan@codesourcery.com
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
The attached program fails to compile with,
nathan@uha:21>g++ -c foo.cc
foo.cc: In function `void Foo(const A&)':
foo.cc:11: call of overloaded `Foo(int)' is ambiguous
foo.cc:7: candidates are: void A::Foo(T) const [with T = int] <near match>
foo.cc:4: void A::Foo(T, int = 0) [with T = int] <near match>
note that function on line 7 is shown with a const qualified
this pointer - the specialization has no const qualifier (and
that is the cause of the problem). I'm sure there are other
cases of specializations changing non-templated parms.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.cc"
c3RydWN0IEEKewogIHRlbXBsYXRlIDx0eXBlbmFtZSBUPiB2b2lkIEZvbyAoVCkgY29uc3Q7CiAg
dGVtcGxhdGUgPHR5cGVuYW1lIFQ+IHZvaWQgRm9vIChULCBpbnQgPSAwKTsKfTsKCnRlbXBsYXRl
IDw+IHZvaWQgQTo6Rm9vIChpbnQpOwoKdm9pZCBGb28gKEEgY29uc3QgJnB0cikKewogIHB0ci5G
b28gKDApOwp9Cgo=