c++/422: Unification algorithm for partial specialization too lenient
gregod@rpi.edu
gregod@rpi.edu
Tue Jul 18 11:56:00 GMT 2000
>Number: 422
>Category: c++
>Synopsis: Unification algorithm for partial specialization too lenient
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Jul 18 11:56:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Douglas Gregor
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
i686-pc-linux
>Description:
g++ returns the error: ambiguous class template
instantiation for `struct A<TypeWrapper<int>, true_type>'.
In both partial specializations of A, T is bound to int, so
typename ProperyX<T>::is_valid (where X is 1 or 2) is known
and should be replaced with true_type and false_type for the
first and second partial specializations. This does not
occur because TYPENAME_TYPEs are ignored in the unify()
function.
>How-To-Repeat:
g++ unify_bug1.C
>Fix:
When all template parameters needed for a template argument
have been bound (T in the above case), the bound parameters
need to be substituted into parameters with nondeduced
contexts (e.g., TYPENAME_TYPE) and unification needs to be
rerun.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="unify_bug1.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="unify_bug1.C"
c3RydWN0IHRydWVfdHlwZSB7fTsKc3RydWN0IGZhbHNlX3R5cGUge307Cgp0ZW1wbGF0ZTx0eXBl
bmFtZSBUPgpzdHJ1Y3QgUHJvcGVydHkxIHsgdHlwZWRlZiBmYWxzZV90eXBlIGlzX3ZhbGlkOyB9
OwoKdGVtcGxhdGU8PgpzdHJ1Y3QgUHJvcGVydHkxPGludD4geyB0eXBlZGVmIHRydWVfdHlwZSBp
c192YWxpZDsgfTsKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CnN0cnVjdCBQcm9wZXJ0eTIgeyB0eXBl
ZGVmIGZhbHNlX3R5cGUgaXNfdmFsaWQ7IH07Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPiBzdHJ1Y3Qg
VHlwZVdyYXBwZXIge307Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBULCB0eXBlbmFtZSBWYWxpZCA9IHRy
dWVfdHlwZT4gc3RydWN0IEEge307Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgpzdHJ1Y3QgQTwgVHlw
ZVdyYXBwZXI8VD4sIHR5cGVuYW1lIFByb3BlcnR5MTwgVCA+Ojppc192YWxpZD4ge307Cgp0ZW1w
bGF0ZTx0eXBlbmFtZSBUPgpzdHJ1Y3QgQTwgVHlwZVdyYXBwZXI8VD4sIHR5cGVuYW1lIFByb3Bl
cnR5MjwgVCA+Ojppc192YWxpZD4ge307CgppbnQKbWFpbigpCnsKICBBPCBUeXBlV3JhcHBlcjxp
bnQ+LCB0cnVlX3R5cGUgPiBhOwp9Cg==
More information about the Gcc-prs
mailing list