https://llvm.org/bugs/show_bug.cgi?id=24819

            Bug ID: 24819
           Summary: -Wmismatched-new-delete confused by reassignment
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: mariofut...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
    Classification: Unclassified

Created attachment 14879
  --> https://llvm.org/bugs/attachment.cgi?id=14879&action=edit
source code to trigger the warning bug

clang reports a mismatched new delete in a legitimate case.

the pointer is first created with new [], then deleted by delete []
and then reallocated with new.

when it is finally deleted with delete I get the warning.

clang does not realise that the live allocation is done with new not new [].

probably even more confusing if the reallocation is conditional.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to