[LLVMbugs] [Bug 21340] New: warning: "cannot delete expression with pointer-to-'void' type 'void *'" missing -W flag

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 22 09:01:35 PDT 2014


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

            Bug ID: 21340
           Summary: warning: "cannot delete expression with
                    pointer-to-'void' type 'void *'" missing -W flag
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fuscated at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Save this snippet as delete_void.cpp 
int main() {
    void *a=new char[100];
    delete [] a;
    return 0;
}


Then execute:
$ clang++ delete_void.cpp 
delete_void.cpp:3:2: warning: cannot delete expression with pointer-to-'void'
type 'void *'
        delete [] a;
        ^         ~
1 warning generated.

There is a warning, but there is no -W flag, so we cannot force it into error
and thus automatically prevent such bugs creeping in the code-base.

Tested with both 3.4 and 3.5.

-- 
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/20141022/66a72324/attachment.html>


More information about the llvm-bugs mailing list