Index: clang/lib/Lex/ModuleMap.cpp =================================================================== --- clang/lib/Lex/ModuleMap.cpp +++ clang/lib/Lex/ModuleMap.cpp @@ -379,6 +379,7 @@ bool ModuleMap::isBuiltinHeader(StringRef FileName) { return llvm::StringSwitch(FileName) .Case("float.h", true) + .Case("inttypes.h", true) .Case("iso646.h", true) .Case("limits.h", true) .Case("stdalign.h", true) Index: clang/test/Modules/Inputs/System/usr/include/module.map =================================================================== --- clang/test/Modules/Inputs/System/usr/include/module.map +++ clang/test/Modules/Inputs/System/usr/include/module.map @@ -4,6 +4,11 @@ header "float.h" } + // In both directories (compiler support version wins, forwards) + module inttypes { + header "inttypes.h" + } + // Only in system headers directory module stdio { header "stdio.h" Index: clang/test/Modules/cstd.m =================================================================== --- clang/test/Modules/cstd.m +++ clang/test/Modules/cstd.m @@ -28,3 +28,11 @@ # error "bool was not defined!" #endif +// Supplied by compiler, which forwards to the "/usr/include" version. +@import cstd.inttypes; +#ifndef __CLANG_INTTYPES_H +#error "__CLANG_INTTYPES_H was not defined!" +#endif +#ifndef MY_PRIi32 +#error "MY_PRIi32 was not defined!" +#endif