[LLVMbugs] [Bug 12525] New: catch variables are treated as garbage or undefined

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 11 13:48:55 PDT 2012


             Bug #: 12525
           Summary: catch variables are treated as garbage or undefined
           Product: clang
           Version: 3.0
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: shartwell at vmware.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ clang --version
Apple clang version 4.0 (tags/Apple/clang-418.0.46) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
$ cat main.cpp

int main(int argc, const char * argv[])
   try {
      throw 42;
   catch (int ie) {
      static int x = 0;
      x = ie;
   return 0;

$ clang --analyze -c main.cpp
main.cpp:9:9: warning: Assigned value is garbage or undefined
      x = ie;
        ^ ~~
1 warning 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