+2012-04-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/52818
+ * c-format.c (CPLUSPLUS_STD_VER): C++11 inherits from C99.
+ (C_STD_NAME): Distinguish between C++98 and C++11.
+
2012-04-11 Eric Botcazou <ebotcazou@adacore.com>
PR target/52624
/* The C standard version C++ is treated as equivalent to
or inheriting from, for the purpose of format features supported. */
-#define CPLUSPLUS_STD_VER STD_C94
+#define CPLUSPLUS_STD_VER (cxx_dialect < cxx11 ? STD_C94 : STD_C99)
/* The C standard version we are checking formats against when pedantic. */
#define C_STD_VER ((int) (c_dialect_cxx () \
? CPLUSPLUS_STD_VER \
pedantic. FEATURE_VER is the version in which the feature warned out
appeared, which is higher than C_STD_VER. */
#define C_STD_NAME(FEATURE_VER) (c_dialect_cxx () \
- ? "ISO C++" \
+ ? (cxx_dialect < cxx11 ? "ISO C++98" \
+ : "ISO C++11") \
: ((FEATURE_VER) == STD_EXT \
? "ISO C" \
: "ISO C90"))
--- /dev/null
+// PR c++/52818
+// { dg-options "-pedantic-errors -Wformat" }
+
+extern "C" int printf (const char *, ...);
+void f() {
+ printf("%lf", 0.0); // { dg-warning "%lf" "" { target c++98 } }
+}