IV34557: NAME LOOKUP ERROR WITH -QLANGLVL=variadictemplates

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Compiling the follwoing test case  gives name lookup error
    using -qlanglvl=variadictemplates or -qlanglvl=extended0x.
    namespace boost { namespace date_time {
      template < class date_type >
      class date_facet {
        void put(char fill_char, date_type const & d) const
        {
          //The following line of code required the date to support
    a to_tm
    function
          to_tm(d);
        }
      };
    }}
    namespace boost { namespace gregorian {
      class date {};
      typedef boost::date_time::date_facet<date> date_facet;
      signed to_tm(date const &)
      {
        return 0;
      }
    }}
    signed main(void) {
      boost::gregorian::date_facet facet;
      return 0;
    }
    $ xlC -q'langlvl=extended0x' -o xlc12_defect_namelookup
    xlc12_defect_namelookup.cpp
    "xlc12_defect_namelookup.cpp", line 24.7: 1540-0274 (S) The name
    lookup for "to_tm" did not find a declaration.
    "xlc12_defect_namelookup.cpp", line 24.7: 1540-1226 (I)
    Declarations for non-dependent names are resolved in the
    template definition.
    "xlc12_defect_namelookup.cpp", line 24.7: 1540-1227 (I) "to_tm"
    does not depend on a template argument.$
    

Local fix

  • 1. Do not use -qlanglvl=variadictemplates or
    -qlanglvl=extended0x;
    2. Move the function "to_tm" into the global namespace.
    

Problem summary

  • PROBLEM DESCRIPTION: Invalid name lookup error found in
    template definition
    
    USERS AFFECTED: The problem may be exposed when using
    -qtmplparse=error or -qlanglvl=variadictemplates allowing the
    compiler to type check non-depenent expressions in a template
    definition.   The compiler was missing the fact that a name was
    dependent and analyzing it in the template definition causing
    the error.
    

Problem conclusion

  • The problem is fixed. Apply recommended service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV34557

  • 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

    2013-01-11

  • Closed date

    2013-03-12

  • Last modified date

    2013-03-25

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

    LI77180

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

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

  • RC10 PSY U858524

       UP C



Rate this page:

(0 users)Average rating

Document information


More support for:

XL C/C++ for AIX
Compiler

Software version:

12.1

Reference #:

IV34557

Modified date:

2013-03-25

Translate my page

Machine Translation

Content navigation