From 92f29a5926d52efea128ffabcf9b45b58039fc63 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sun, 12 Jun 2016 22:40:36 +0300
Subject: Check compilation with and without -std flag.

This allow fix issue with C++11 flags where one std include, including other std files.
---
 tools/ci/jobs/deheader.sh   |  3 ++-
 tools/ci/samples/test11.cpp | 18 ++++++++++++++++++
 tools/ci/samples/test11.h   |  6 ++++++
 tools/ci/samples/test12.h   | 16 ++++++++++++++++
 4 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 tools/ci/samples/test11.cpp
 create mode 100644 tools/ci/samples/test11.h
 create mode 100644 tools/ci/samples/test12.h

(limited to 'tools/ci')

diff --git a/tools/ci/jobs/deheader.sh b/tools/ci/jobs/deheader.sh
index 314506f..25cd26c 100755
--- a/tools/ci/jobs/deheader.sh
+++ b/tools/ci/jobs/deheader.sh
@@ -18,5 +18,6 @@ echo $3
 ${dir}/deheader -q \
 -c "$1" \
 -d "$2" \
--m "-c -std=gnu++1z -Werror -Wall -Wextra -Wundef -Wmissing-declarations -I/usr/include -I${dir}/tools/ci/samples" ${dir}/tools/ci/samples/$3 \
+-s "-std=gnu++1z" \
+-m "-c -Werror -Wall -Wextra -Wundef -Wmissing-declarations -I/usr/include -I${dir}/tools/ci/samples" ${dir}/tools/ci/samples/$3 \
 | grep -v "portability requires" | tee -a ${LOGFILE}
diff --git a/tools/ci/samples/test11.cpp b/tools/ci/samples/test11.cpp
new file mode 100644
index 0000000..89430b5
--- /dev/null
+++ b/tools/ci/samples/test11.cpp
@@ -0,0 +1,18 @@
+#include "test11.h"
+
+#include <map>
+#include <string>
+
+class Class1
+{
+    Class1(const std::string &str) :
+        mStr(str)
+    {
+    }
+    const std::string mStr;
+};
+
+int function1()
+{
+    return 0;
+}
diff --git a/tools/ci/samples/test11.h b/tools/ci/samples/test11.h
new file mode 100644
index 0000000..53ef57d
--- /dev/null
+++ b/tools/ci/samples/test11.h
@@ -0,0 +1,6 @@
+#ifndef TEST11
+#define TEST11
+
+int function1();
+
+#endif  // TEST11
diff --git a/tools/ci/samples/test12.h b/tools/ci/samples/test12.h
new file mode 100644
index 0000000..3dac36c
--- /dev/null
+++ b/tools/ci/samples/test12.h
@@ -0,0 +1,16 @@
+#ifndef TEST12
+#define TEST12
+
+#include <map>
+#include <string>
+
+class Class1
+{
+    Class1(const std::string &str) :
+        mStr(str)
+    {
+    }
+    const std::string mStr;
+};
+
+#endif  // TEST12
-- 
cgit v1.2.3-70-g09d2