[LLVMbugs] [Bug 15595] New: '-Winvalid-return' triggers warning for destructor with 'noreturn' attribute

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 26 04:53:40 PDT 2013


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

            Bug ID: 15595
           Summary: '-Winvalid-return' triggers warning for destructor
                    with 'noreturn' attribute
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: andrewjcg at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compiling a class with a destructor with the 'noreturn' attribute causes a
warning with the -Winvalid-noreturn flag.  I compile the following code snippet
with clang-3.2 and the '-Winvalid-return' flag:

  class Test {
  public:
    Test() {}
    __attribute__((noreturn)) ~Test() {}
  };

compile error:

  test.cpp:4:38: warning: function declared 'noreturn' should not return
[-Winvalid-noreturn]
    __attribute__((noreturn)) ~Test() {}
                                     ^
  1 warning generated.

I came across this issue when trying to debug an apparent false positive
dereference non-null static analysis check.  It seems that clang doesn't detect
that it can eliminate a path with a local variable instance of a class with a
'noreturn' destructor.

-- 
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/20130326/33ee8d43/attachment.html>


More information about the llvm-bugs mailing list