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

            Bug ID: 20009
           Summary: std::vector::insert(position, n, x) does not respect
                    exceptions
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Created attachment 12645
  --> http://llvm.org/bugs/attachment.cgi?id=12645&action=edit
insert_n.cc

% g++ ./insert_n.cc && ./a.out 
THROW
% clang++ ./insert_n.cc && ./a.out 
THROW
% clang++  -I$LIBCXX_ROOT/include  $LIBCXX_ROOT/lib/libc++.so 
-Wl,-R$LIBCXX_ROOT/lib ./insert_n.cc  && ./a.out 
a.out: ./insert_n.cc:35: int main(): Assertion `0' failed.
Aborted (core dumped)
% 

The code: 

  try {
    v.insert(v.begin(), 2, X(66));  <<<<< The CTOR should throw
    assert(0);

Looks like this variant of insert does not call copy ctors and hence they don't
throw. Sounds like a bug to me.

-- 
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