summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/PR27739/DataInputHandler.h19
-rw-r--r--clang/test/Modules/Inputs/PR27739/Types.h1
-rw-r--r--clang/test/Modules/Inputs/PR27739/map20
-rw-r--r--clang/test/Modules/Inputs/PR27739/module.modulemap2
-rw-r--r--clang/test/Modules/pr27739.cpp12
5 files changed, 54 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/PR27739/DataInputHandler.h b/clang/test/Modules/Inputs/PR27739/DataInputHandler.h
new file mode 100644
index 00000000000..1ef02ecb8da
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27739/DataInputHandler.h
@@ -0,0 +1,19 @@
+template < typename > struct vector {};
+
+#include <map>
+#include "Types.h"
+
+struct TString {
+ TString (char *);
+};
+
+struct TreeInfo {};
+
+class DataInputHandler {
+ void AddTree ();
+ void SignalTreeInfo () {
+ fInputTrees[(char*)""];
+ }
+ map <TString, vector <TreeInfo> >fInputTrees;
+ map <string, bool> fExplicitTrainTest;
+};
diff --git a/clang/test/Modules/Inputs/PR27739/Types.h b/clang/test/Modules/Inputs/PR27739/Types.h
new file mode 100644
index 00000000000..6d458a8d982
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27739/Types.h
@@ -0,0 +1 @@
+#include <map>
diff --git a/clang/test/Modules/Inputs/PR27739/map b/clang/test/Modules/Inputs/PR27739/map
new file mode 100644
index 00000000000..612685c9e5b
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27739/map
@@ -0,0 +1,20 @@
+#ifndef _GLIBCXX_MAP
+#define _GLIBCXX_MAP
+struct basic_string {
+ basic_string(char *);
+} typedef string;
+
+template <typename> class D;
+template <typename _Elements> struct D {
+ _Elements _M_;
+ D(D &) = default;
+};
+
+template <typename _Elements> D<_Elements &&> forward_as_tuple(_Elements);
+
+template <typename _Key, typename _Tp> struct map {
+ _Tp operator[](_Key p1) {
+ auto b = &forward_as_tuple(p1);
+ }
+};
+#endif
diff --git a/clang/test/Modules/Inputs/PR27739/module.modulemap b/clang/test/Modules/Inputs/PR27739/module.modulemap
new file mode 100644
index 00000000000..d611e8079e5
--- /dev/null
+++ b/clang/test/Modules/Inputs/PR27739/module.modulemap
@@ -0,0 +1,2 @@
+module "DataInputHandler.h" { header "DataInputHandler.h" export * }
+module "Types.h" { header "Types.h" export *}
diff --git a/clang/test/Modules/pr27739.cpp b/clang/test/Modules/pr27739.cpp
new file mode 100644
index 00000000000..b27dc1b0937
--- /dev/null
+++ b/clang/test/Modules/pr27739.cpp
@@ -0,0 +1,12 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -std=c++11 -internal-externc-isystem %S/Inputs/PR27739 -verify %s
+// RUN: %clang_cc1 -std=c++11 -fmodules -fmodule-map-file=%S/Inputs/PR27739/module.modulemap -fmodules-cache-path=%t -internal-externc-isystem %S/Inputs/PR27739/ -verify %s
+
+#include "DataInputHandler.h"
+
+void DataInputHandler::AddTree() {
+ fInputTrees[(char*)""];
+ fExplicitTrainTest[(char*)""];
+}
+
+// expected-no-diagnostics
OpenPOWER on IntegriCloud