http://llvm.org/bugs/show_bug.cgi?id=21525

            Bug ID: 21525
           Summary: Segmentation fault: Using template specialization and
                    default function attributes
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Created attachment 13310
  --> http://llvm.org/bugs/attachment.cgi?id=13310&action=edit
Source

Clang crashes with the following snippet:

#include <iostream>

template <typename type, typename unit, unit Default>
class Base
{
public:
   template <typename settype>
   inline void set( settype v1 = 0, unit v2 = Default  )
   { std::cout << __PRETTY_FUNCTION__ << std::endl; }
};


enum eUnit
{
   Default = 10
};

typedef Base< int, eUnit, Default > BType;

template<>
template<typename settype>
inline void BType::set( settype v1, eUnit v2 )
{ std::cout << __PRETTY_FUNCTION__ << std::endl; }


int main( void )
{
   BType v;

   // Working
   v.set( 1, Default );
   // Seg fault
   v.set( 1 );

   return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to