This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7319: misleading template in error message


>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=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]