c++/4653: template instantiation not in sync with Koenig's lookup

gawrilow@math.tu-berlin.de gawrilow@math.tu-berlin.de
Thu Oct 25 16:26:00 GMT 2001


>Number:         4653
>Category:       c++
>Synopsis:       template instantiation not in sync with Koenig's lookup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 16:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ewgenij Gawrilow
>Release:        3.0.1
>Organization:
>Environment:
Solaris 8 @ UltraSPARC; Linux @ i686
>Description:
If the point of instantiation of a class template coincides
with a call to a function which can be found only via Koenig's
lookup, and the latter can succeed only if the
instantiation is already done (since the base class of the
class template is involved,) then the lookup fails. The
instantiation is done, nevertheless, since the similar calls
later on in the code produce no diagnostic!

I think, this case deserves special treatment, in that Koenig's
lookup should be done after the instantiation, whereas the
usual one can happen before.
>How-To-Repeat:
Compile the attached code sample.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="koenig.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="koenig.cc"

bmFtZXNwYWNlIEEgewogICBjbGFzcyByb290IHsgfTsKCiAgIHRlbXBsYXRlIDxjbGFzcyBYLCBj
bGFzcyBZPgogICBib29sIG9wZXJhdG9yPT0gKGNvbnN0IFgmLCBjb25zdCBZJikgewogICAgICBy
ZXR1cm4gdHJ1ZTsKICAgfQoKICAgdGVtcGxhdGUgPGNsYXNzIFgsIGNsYXNzIFk+CiAgIGJvb2wg
b3BlcmF0b3IhPSAoY29uc3QgWCYsIGNvbnN0IFkmKSB7CiAgICAgIHJldHVybiBmYWxzZTsKICAg
fQp9OwoKdGVtcGxhdGUgPGNsYXNzIFQ+CmNsYXNzIEIgOiBwdWJsaWMgQTo6cm9vdCB7IH07Cgpi
b29sIGZvbyhjb25zdCBCPGludD4mIGIxLCBjb25zdCBCPGNoYXI+JiBiMikgewogICBib29sIHg9
IGIxPT1iMjsKICAgYm9vbCB5PSBiMSE9YjI7CiAgIGJvb2wgej0gYjI9PWIxOwogICByZXR1cm4g
eCB8fCB5IHx8IHo7Cn0K



More information about the Gcc-bugs mailing list