diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-10-03 00:31:35 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-10-03 00:31:35 +0000 |
commit | ef99e4d88a251ca162e5611b05ea769a8574a68d (patch) | |
tree | ebbd3fcf8eeb5f511d5fc2b355c2934df09d341c /clang/test/Modules/stddef.c | |
parent | 5312afe7e1b9646d096e92b30fcaf720c93186f9 (diff) | |
download | bcm5719-llvm-ef99e4d88a251ca162e5611b05ea769a8574a68d.tar.gz bcm5719-llvm-ef99e4d88a251ca162e5611b05ea769a8574a68d.zip |
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
Diffstat (limited to 'clang/test/Modules/stddef.c')
-rw-r--r-- | clang/test/Modules/stddef.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Modules/stddef.c b/clang/test/Modules/stddef.c new file mode 100644 index 00000000000..aefc90f9a11 --- /dev/null +++ b/clang/test/Modules/stddef.c @@ -0,0 +1,13 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/StdDef %s -verify -fno-modules-error-recovery + +#include "ptrdiff_t.h" + +ptrdiff_t pdt; + +size_t st; // expected-error {{must be imported}} +// expected-note@stddef.h:* {{previous}} + +#include "include_again.h" + +size_t st2; |