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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


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

Reply via email to