Fix interaction of max_align_t and modules.
When building with modules enabled, we were defining max_align_t as a typedef
for a different anonymous struct type each time it was included, resulting in
an error if <stddef.h> is not covered by a module map and is included more than
once in the same modules-enabled compilation of C11 or C++11 code.
llvm-svn: 218931
diff --git a/clang/test/Modules/Inputs/StdDef/include_again.h b/clang/test/Modules/Inputs/StdDef/include_again.h
new file mode 100644
index 0000000..f29f636
--- /dev/null
+++ b/clang/test/Modules/Inputs/StdDef/include_again.h
@@ -0,0 +1,2 @@
+#include <stddef.h>
+
diff --git a/clang/test/Modules/Inputs/StdDef/module.map b/clang/test/Modules/Inputs/StdDef/module.map
index 69c69ea..5c4e0da 100644
--- a/clang/test/Modules/Inputs/StdDef/module.map
+++ b/clang/test/Modules/Inputs/StdDef/module.map
@@ -8,4 +8,14 @@
header "other.h"
export *
}
+
+ module PtrDiffT {
+ header "ptrdiff_t.h"
+ export *
+ }
+
+ module IncludeAgain {
+ header "include_again.h"
+ export *
+ }
}
diff --git a/clang/test/Modules/Inputs/StdDef/ptrdiff_t.h b/clang/test/Modules/Inputs/StdDef/ptrdiff_t.h
new file mode 100644
index 0000000..acb0ab8
--- /dev/null
+++ b/clang/test/Modules/Inputs/StdDef/ptrdiff_t.h
@@ -0,0 +1,2 @@
+#define __need_ptrdiff_t
+#include <stddef.h>