[LLVMbugs] [Bug 21293] New: ambiguous template instantiation crashes clang++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 15 16:29:50 PDT 2014


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

            Bug ID: 21293
           Summary: ambiguous template instantiation crashes clang++
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: xz558 at nyu.edu
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13208
  --> http://llvm.org/bugs/attachment.cgi?id=13208&action=edit
Peprocessed source

clang++ 3.4 crashes with the following simple program. g++ 4.8 reports
'ambiguous template specialization'.

template < typename T >
class DummyClass {
 public:
  DummyClass(const T &t) {};

  template< typename S >
  DummyClass(const S &s) {};

  void dummyFunction(const T &t) {};

  template< typename S >
  void dummyFunction(const S &s) {};
};

// These template instantiations are okay
template class DummyClass< int >;
template DummyClass< int >::DummyClass(const double &s);
template DummyClass< int >::dummyFunction(const double &s);

// These template instantiations will cause segmentation fault for clang++ 3.4
// In g++ 4.8, it reports 'ambiguous template specialization'.
template DummyClass< int >::DummyClass(const int &s);
template void DummyClass< int >::dummyFunction(const int &s);

int main() {
  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/20141015/8d42e134/attachment.html>


More information about the llvm-bugs mailing list