Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-1002

[Sun C++ 5.9] partial specialization on cv-qualifiers broken for array types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • External
    • None
    • SunOS marbles 5.10 Generic_118855-33 i86pc i386 i86pc
      CC: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25

    • Incorrect Behavior

    Description

      $ cat t.cpp && CC t.cpp
      
      template <class T>
      struct __rw_is_const
      {
          enum { value = 0 };
      };
      
      template <class T>
      struct __rw_is_const<const T>
      {
          enum { value = 1 };
      };
      
      extern "C" int printf (const char*, ...);
      
      int main ()
      {
      #define test(X) if (!(X)) printf ("%s != 1\n", #X)
      
          test (!__rw_is_const<int>::value);
          test (__rw_is_const<const int>::value);
          test (__rw_is_const<const int []>::value);
          test (__rw_is_const<const int [2]>::value);
      
          return 0;
      }
      __rw_is_const<const int []>::value != 1
      __rw_is_const<const int [2]>::value != 1
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            vitek Travis Vitek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: