[LLVMbugs] [Bug 10063] New: Problems with 'switch' and destructors in control flow graph

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 1 16:03:49 PDT 2011


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

           Summary: Problems with 'switch' and destructors in control flow
                    graph
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: matthewbg at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=6673)
 --> (http://llvm.org/bugs/attachment.cgi?id=6673)
test cases

The attached file has a number of testcases which should not trigger
-Wreturn-type. In all cases, control enters a switch statement with no cases
but 'default', and the default case instantiates an object with a noreturn
destructor. We get it right in a few cases, but not all:

$ clang -fsyntax-only -Wreturn-type ~/testcases/noreturn_dtor_switch.cc 
/home/matthewbg/testcases/noreturn_dtor_switch.cc:24:1: warning: control
reaches end of non-void function [-Wreturn-type]
} // 2
^
/home/matthewbg/testcases/noreturn_dtor_switch.cc:46:1: warning: control
reaches end of non-void function [-Wreturn-type]
} // 5
^
/home/matthewbg/testcases/noreturn_dtor_switch.cc:54:1: warning: control
reaches end of non-void function [-Wreturn-type]
} // 6
^
/home/matthewbg/testcases/noreturn_dtor_switch.cc:62:1: warning: control
reaches end of non-void function [-Wreturn-type]
} // 7
^
/home/matthewbg/testcases/noreturn_dtor_switch.cc:70:1: warning: control
reaches end of non-void function [-Wreturn-type]
} // 8
^
5 warnings generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list