diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap --- a/libcxx/include/module.modulemap +++ b/libcxx/include/module.modulemap @@ -989,7 +989,7 @@ module __function_like { private header "__function_like.h" export * } module __hash_table { header "__hash_table" export * } module __locale { private header "__locale" export * } - module __mbstate { private header "__mbstate_t.h" export * } + module __mbstate_t { private header "__mbstate_t.h" export * } module __mutex_base { private header "__mutex_base" export * } module __node_handle { private header "__node_handle" export * } module __nullptr { header "__nullptr" export * } diff --git a/libcxx/test/libcxx/lint/lint_modulemap.sh.py b/libcxx/test/libcxx/lint/lint_modulemap.sh.py --- a/libcxx/test/libcxx/lint/lint_modulemap.sh.py +++ b/libcxx/test/libcxx/lint/lint_modulemap.sh.py @@ -18,6 +18,19 @@ with open(modulemap_name, 'r') as f: for line in f.readlines(): if re.match(r'^\s*module.*[{]\s*private', line): + # Check that these lines are all of the expected format. + # This incidentally checks for typos in the module name. + if re.match(r'^\s*module (\w+)\s+[{] private header "\1(.h)?"\s+export [*] [}]', line): + # It's a top-level private header, such as <__bit_reference>. + pass + elif re.match(r'^\s*module (\w+)\s+[{] private header "__\w+/\1[.]h" [}]', line): + # It's a private submodule, such as <__utility/swap.h>. + pass + else: + okay = False + print("LINE DOESN'T MATCH REGEX in libcxx/include/module.modulemap!") + print(line) + # Check that these lines are alphabetized. if (prevline is not None) and (line < prevline): okay = False print('LINES OUT OF ORDER in libcxx/include/module.modulemap!')