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

[Sun C++ 5.9] ICE during overload selection

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: 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 B, class D>
      struct __is_base_of
      {
          struct __no  { };
          struct __yes { __no __pad [2]; };
      
          template <class T>
          static __yes __is (const volatile D&, T);
          static __no  __is (const volatile B&, int);
      
          struct __nest
          {
              operator const volatile B& () const;
              operator const volatile D& ();
          };
      
          enum { value =
              sizeof (__yes) == sizeof (__is (__nest (), 0))
          };
      };
      
      extern "C" int printf (const char*, ...);
      
      struct B { };
      struct D : B { };
      
      int main ( int argc, char * argv [ ] )
      {
      #define test(X) printf ("%s = %d\n", #X, X)
      
          test ((__is_base_of<B, D>::value));
          test ((__is_base_of<B, B>::value));
          test ((__is_base_of<D, D>::value));
      
          return 0;
      }
       >> Assertion:   (../lnk/tmplmatchargs.cc, line 193)
          while processing t.cpp at line 32.
      

      Filed with Sun as bug #6728467.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: