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

           Summary: initialized if it is a static const integral data
                    member
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
   Estimated Hours: 0.0


Getting another piece of production code to compile the next error is:

test.cc:5:26: error: in-class initializer has non-integral, non-enumeration
type 'double'

While the type is a double in this case. This is tested in the clang testsuite:

test/SemaTemplate/instantiate-static-var.cpp

template<typename T>
class Y {
 static const T value = 0; // expected-error{{'value' can only be initialized
if it is a static const integral data member}}
};

Y<float> fy; // expected-note{{in instantiation of template class 'class
Y<float>' requested here}}

G++, even including the latest 4.4, does not even warn about this on neither
-Wall, nor -Wextra, only with -pedantic. I assume due to this other POD
initialization, especially of FP types will occur in quite some shipping code
and thus suggest making it a warning by default, likewise.

-- 
Configure bugmail: http://www.llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to