[LLVMbugs] [Bug 21525] New: Segmentation fault: Using template specialization and default function attributes

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 10 23:20:11 PST 2014


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: unassignedclangbugs at nondot.org
          Reporter: matthias.scholz at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141111/d91c9917/attachment.html>


More information about the llvm-bugs mailing list