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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to