IBM Support

LI75055: FUNCTION RESOLUTION FAILURE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following reduced test case gives out function resolution
    error compiled with xlC. g++ compiles fine.
    
    <small.cxx>
    void func(bool arg){}
    void func(void* arg){}
    
    int main()
    {
    int nCorners[3] = {0, 0, 0};
    func( (nCorners) );
    return 0;
    }
    </small.cxx>
    
    $ xlC small.cxx
    "small.cxx", line 7.1: 1540-0219 (S) The call to "func" has no
    best match.
    "small.cxx", line 7.7: 1540-1228 (I) Argument number 1 is an
    lvalue of type "int [3]".
    "small.cxx", line 2.6: 1540-1202 (I) No candidate is better than
    "func(void *)".
    "small.cxx", line 7.7: 1540-1231 (I) The conversion from
    argument number 1 to "void *" uses "an array-to-pointer
    transformation" followed by "a pointer conversion".
    "small.cxx", line 1.6: 1540-1202 (I) No candidate is better than
    "func(bool)".
    "small.cxx", line 7.7: 1540-1231 (I) The conversion from
    argument number 1 to "bool" uses "an array-to-pointer
    transformation" followed by "a boolean conversion".
    

Local fix

  • Replace statement
    
    func( (nCorners) );
    
    with
    
    func( void* (nCorners) );
    

Problem summary

  • USERS AFFECTED:
    Users with overloaded functions, especially with con-
    version from pointer to member to bool.
    
    PROBLEM DESCRIPTION:
    The compiler fails to choose the correct function especially
    when the program has two overloaded functions with
    the same rank.
    

Problem conclusion

  • The compiler is now able to handle functions with overload
    resolution
    having the same rank.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75055

  • Reported component name

    XL C/C++ RHEL52

  • Reported component ID

    5724U8310

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-12-01

  • Closed date

    2009-12-01

  • Last modified date

    2009-12-01

  • APAR is sysrouted FROM one or more of the following:

    IZ51552

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C/C++ RHEL52

  • Fixed component ID

    5724U8310

Applicable component levels

  • RA10 PSY

       UP

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
14 October 2021