[LLVMbugs] [Bug 8091] New: clang crash with member templates

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 6 01:07:39 PDT 2010


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

           Summary: clang crash with member templates
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pip88nl at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5459)
 --> (http://llvm.org/bugs/attachment.cgi?id=5459)
error output from clang -c -v clang-broken.ii

Clang revision 113114 crashes in certain uses of nested templates. It does not
crash if a builtin type is used as argument to allocator instead of struct
pair. It does still crash if struct pair is forward declared or defined.

Unfortunately, bugzilla doesn't allow me to attach multiple files, so here is
the code:


// BEGIN
template<typename _Tp>
struct allocator
{
  template<typename _Tp1>
  struct rebind
  {
    typedef allocator<_Tp1> other;
  };
};


template<typename _Alloc>
struct _Rb_tree
{
  typedef typename _Alloc::template rebind<char>::other _Node_allocator;
  typedef int const_reverse_iterator;

  struct _Rb_tree_impl
    : _Node_allocator
  {
  };

  _Rb_tree_impl _M_impl;
};


typedef _Rb_tree<allocator<struct pair> >::const_reverse_iterator
const_reverse_iterator;
// END

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list