Enforce module decl-use restrictions and private header restrictions in textual headers
authorRichard Smith <richard@metafoo.co.uk>
Wed, 7 Sep 2022 00:10:55 +0000 (17:10 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Wed, 7 Sep 2022 00:12:57 +0000 (17:12 -0700)
commita002063de37c00133b93d2ce1f0ea78fc4b807ff
tree989e7879059bf93a6b575dbe982a3085f3424e54
parent4f5147a7cff5fbb0191342ad224630de0872f180
Enforce module decl-use restrictions and private header restrictions in textual headers

Per the documentation, these restrictions were intended to apply to textual headers but previously this didn't work because we decided there was no requesting module when the `#include` was in a textual header.

A `-cc1` flag is provided to restore the old behavior for transitionary purposes.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D132779
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/Options.td
clang/include/clang/Lex/Preprocessor.h
clang/lib/Lex/PPDirectives.cpp
clang/test/Modules/Inputs/declare-use/module.map
clang/test/Modules/Inputs/declare-use/textual.h [new file with mode: 0644]
clang/test/Modules/declare-use-textual.cpp [new file with mode: 0644]