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

             Bug #: 14702
           Summary: Possible false positive in GCC complex header
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


On a fairly standard Ubuntu 12.10 using clang 3.2 I get the following warning
from the GCC 4.7.2 complex header file

/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../include/c++/4.7/complex:1311:13:
warning: Assigned value is garbage
      or undefined
          _M_value *= __t;
                   ^  ~~~
1 warning generated.


Looking at the header code

      template<typename _Tp>
        complex&
        operator*=(const complex<_Tp>& __z)
        {
          _ComplexT __t;
          __real__ __t = __z.real();
          __imag__ __t = __z.imag();
          _M_value *= __t;
          return *this;
        }

I can't see why I should get this error as it looks like the __t variable is
not garbage.

-- 
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