aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-05-09 00:50:10 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-05-09 00:50:10 -0400
commitfe191308ddc9bb7095d01bcd11dcaf1f38c84bab (patch)
tree61fa36eb422bfdf8906071bacaa096b5ef2c2dbc /gcc
parent169980942642c39a062529f747e00a7882d046d7 (diff)
downloadgcc-fe191308ddc9bb7095d01bcd11dcaf1f38c84bab.zip
gcc-fe191308ddc9bb7095d01bcd11dcaf1f38c84bab.tar.gz
gcc-fe191308ddc9bb7095d01bcd11dcaf1f38c84bab.tar.bz2
lex.c (lex_string): Add -Wc++11-compat warning.
libcpp/ * lex.c (lex_string): Add -Wc++11-compat warning. * include/cpplib.h: Add CPP_W_CXX11_COMPAT. (struct cpp_options): Add cpp_warn_cxx11_compat. * init.c (cpp_create_reader): Initialize it. gcc/c-family/ * c.opt (Wc++0x-compat): Set it. From-SVN: r222961
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c.opt2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C4
3 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 57f83c9..17fb72f 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2015-05-08 Jason Merrill <jason@redhat.com>
+
+ * c.opt (Wc++0x-compat): Also set cpp_warn_cxx11_compat.
+
2015-05-08 Marek Polacek <polacek@redhat.com>
PR c/64918
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 3774a89..8f48d84 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -312,7 +312,7 @@ C ObjC Var(warn_cxx_compat) CPP(warn_cxx_operator_names) CppReason(CPP_W_CXX_OPE
Warn about C constructs that are not in the common subset of C and C++
Wc++0x-compat
-C++ ObjC++ Var(warn_cxx0x_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
+C++ ObjC++ Var(warn_cxx0x_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT)
Deprecated in favor of -Wc++11-compat
Wc++11-compat
diff --git a/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C
new file mode 100644
index 0000000..c3f0cf5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/warn_cxx0x4.C
@@ -0,0 +1,4 @@
+// { dg-options "-Wall" }
+
+#define FOO "foo"
+const char *p = "bar"FOO; // { dg-warning "macro" }