[LLVMbugs] [Bug 16331] New: Static analyzer does not honor attribute noreturn in destructors

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 14 10:26:42 PDT 2013


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

            Bug ID: 16331
           Summary: Static analyzer does not honor attribute noreturn in
                    destructors
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: labath at google.com
                CC: klimek at google.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On the following input file, the static analyzer reports a "Called C++ object
pointer is null" warning, even though the offending statement is never reached,
since the destructor of A never returns.

$ cat a.cc
struct Fatal { ~Fatal() __attribute__((noreturn)); };

struct A { void a(); };

void f(A* a) {
  a ? (void) 0 : (void)Fatal();
  a->a();
}

$ ~/llvm/build/bin/clang --analyze a.cc 
a.cc:7:3: warning: Called C++ object pointer is null
  a->a();
  ^~~~~~
1 warning generated.

-- 
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/20130614/c464fad6/attachment.html>


More information about the llvm-bugs mailing list