IBM Support

IV64515: AN EXPRESSION OF TYPE "INT" MUST NOT BE FOLLOWED BY THE FUNCTION CALL OPERATOR () ERROR

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The compiler generates an incorrect error message as shown below
    for the provided test case:
    
    ===== COMPILE COMMAND:
    xlC_r -q32 -qthreaded -qalias=ansi -qlanglvl=extended0x
    -qsuppress=1540-0198 -c test.cpp
    
    ===== TESTCASE:
    $ cat test.cpp
    namespace template_test {
        class FactoryBase {
        public:
            int value()      const;
        };
    
        class ReaderFactory : public FactoryBase
        {
        };
        class WriterFactory : public FactoryBase
        {
        };
    
        class DescriptionBase
        {
        public:
            virtual ?DescriptionBase() { }
    
            virtual ReaderFactory getRFactory() const = 0;
            virtual WriterFactory getWFactory() const = 0;
        };
    
        template<class FactoryType>
        struct DescriptionFactory
        {
            static FactoryType getFactory(DescriptionBase *);
        };
    
        template<>
        struct DescriptionFactory<ReaderFactory>
        {
            static ReaderFactory getFactory(DescriptionBase * _ptr)
            {
                return _ptr->getRFactory();
            }
        };
    
        template<>
        struct DescriptionFactory<WriterFactory>
        {
            static WriterFactory getFactory(DescriptionBase * _ptr)
            {
                return _ptr->getWFactory();
            }
        };
    
        class TemplateClass
        {
        public:
            template<typename Factory>
            int templateFunction(const DescriptionBase *);
        };
    }
    
    template<typename Factory>
    int
    template_test::TemplateClass::templateFunction(const
    DescriptionBase * seriesList)
    {
        Factory factory =
    DescriptionFactory<Factory>::getFactory(seriesList);
        return factory.value();
    }
    
    class NormalClass
    {
    protected:
        template_test::TemplateClass m_repositories;
    
    public:
        template<typename Factory>
        int
        templateFunction(const template_test::DescriptionBase *
    list)
        {
            return m_repositories.templateFunction<Factory>(list);
        }
    };
    $
    
    
    ===== ACTUAL OUTPUT:
    // xlC_r -q32 -qthreaded -qalias=ansi -qlanglvl=extended0x
    -qsuppress=1540-0198 -c test.cpp
    
    //
    // Result:
    // "test.cpp", line 66.23: 1540-0204 (S) An expression of type
    "int" must not be followed by the function call operator ().
    // "test.cpp", line 64.1: 1540-0700 (I) The previous message
    was produced while processing
    "template_test::TemplateClass::templateFunction<Factory>(const
    DescriptionBase *)".
    // "test.cpp", line 80.30: 1540-0700 (I) The previous message
    was produced while processing "template <class Factory>
    NormalClass::templateFunction(const DescriptionBase *)".
    
    ===== EXPECTED OUTPUT:
    Should compile clean
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users who use -qlanglvl=extended0x or -qtmplparse=error may be
    affected by this issue.
    
    PROBLEM DESCRIPTION:
    Template type checking enabled by -qlanglvl=extended0x or
    -qtmplparse=error was attempting to do too much processing
    causing an invalid error.
    

Problem conclusion

  • The compiler has been fixed to handle the above scenario.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV64515

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-09-03

  • Closed date

    2014-10-23

  • Last modified date

    2014-10-23

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

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

    IV67993 LI78464

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels



Document information

More support for: XL C/C++ for AIX
Compiler

Software version: 12.1

Reference #: IV64515

Modified date: 23 October 2014