c++/9420: [3.2/3.3/3.4 regression] incomplete type incorrectly reported

jason@gcc.gnu.org jason@gcc.gnu.org
Thu Mar 13 21:02:00 GMT 2003


Synopsis: [3.2/3.3/3.4 regression] incomplete type incorrectly reported

State-Changed-From-To: open->analyzed
State-Changed-By: jason
State-Changed-When: Thu Mar 13 20:26:21 2003
State-Changed-Why:
    Core issues 63 and 212 are relevant here.  [temp.inst] says
    
    A class template specialization is implicitly instantiated if the class type is used in a context that requires a completely-defined object type or if the completeness of the class type might affect the semantics of the program. [Note: in particular, if the semantics of an expression depend on the member or base class lists of a class template specialization, the class template specialization is implicitly generated. For instance, deleting a pointer to class type depends on whether or not the class declares a destructor, and conversion between pointer to class types depends on the inheritance relationship between the two classes involved. ]
    ...
    If the overload resolution process can determine the correct function to call without instantiating a class
    template definition, it is unspecified whether that instantiation actually takes place.
    
    In this case, we need to do overload resolution for E<0,
    because E is an enum.  We consider op<(C,C) as a candidate.
    To test whether or not it is a valid candidate, we need to
    determine whether or not there is a conversion from E (and
    int) to C.
    
    Hmm...
    
    No, I'm making this harder than it actually is.  The bug is
    that we're instantiating B<int> when we don't need to,
    because we can't use a user-defined conversion from E (or int)
    to B<int>, because we're already considering a UDC to C.
    This should be simple to fix.

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



More information about the Gcc-bugs mailing list