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

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

Reply via email to