+2010-11-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR preprocessor/45038
+ * c-cppbuiltin.c (c_cpp_builtins): Use different format for C++
+ dialects.
+
2010-11-12 Joseph Myers <joseph@codesourcery.com>
* c-common.h (c_family_lang_mask): Declare.
/* Cast the double precision constants. This is needed when single
precision constants are specified or when pragma FLOAT_CONST_DECIMAL64
is used. The correct result is computed by the compiler when using
- macros that include a cast. */
- builtin_define_float_constants ("DBL", "L", "((double)%s)", "",
- double_type_node);
+ macros that include a cast. We use a different cast for C++ to avoid
+ problems with -Wold-style-cast. */
+ builtin_define_float_constants ("DBL", "L",
+ (c_dialect_cxx ()
+ ? "double(%s)"
+ : "((double)%s)"),
+ "", double_type_node);
builtin_define_float_constants ("LDBL", "L", "%s", "L",
long_double_type_node);
+2010-11-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR preprocessor/45038
+ * g++.dg/pr45038.C: New test.
+
2010-11-15 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46467
--- /dev/null
+// PR preprocessor/45038
+// { dg-do compile }
+// { dg-options "-Werror -Wold-style-cast" }
+
+double f(void)
+{
+ // We used to produce old-style casts for this.
+ return __DBL_MIN__;
+}