This test detects redefinitions by compiling stdc++.h and <version>, by
disabling the system_header pragma on the latter, to allow warnings in
it. Thanks Patrick Palka for the suggestion.
libstdc++-v3/ChangeLog:
* testsuite/17_intro/versionconflict.cc: New test.
* include/std/version: Allow disabling the system_header pragma
via _GLIBCXX_TESTING_SYSHDR.
#ifndef _GLIBCXX_VERSION_INCLUDED
#define _GLIBCXX_VERSION_INCLUDED
-#pragma GCC system_header
+// To facilitate testsuite/17_intro/versionconflict.cc
+#ifndef _GLIBCXX_TESTING_SYSHDR
+# pragma GCC system_header
+#endif
#include <bits/c++config.h>
--- /dev/null
+// { dg-do preprocess }
+// { dg-additional-options "-Werror" }
+
+// Test for redefinitions of FTMs using bits/stdc++.h.
+#define _GLIBCXX_TESTING_SYSHDR
+#include <bits/stdc++.h>
+#include <version>