C++ Standard Library
  1. C++ Standard Library
  2. STDCXX-1002

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: External
    • Labels:
      None
    • Environment:

      SunOS marbles 5.10 Generic_118855-33 i86pc i386 i86pc
      CC: Sun C++ 5.9 SunOS_i386 Patch 124864-01 2007/07/25

    • Severity:
      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
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Travis Vitek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development