[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > FWIW, we saw failures at Google (where, to the best of my knowledge, we > > aren't using named modules at all) that look like this: > > ``` > > error: '#include ' attaches the declarations to the named module > > '.get', which is not usually intended; consider moving that

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > FWIW, we saw failures at Google (where, to the best of my knowledge, we > aren't using named modules at all) that look like this: > > ``` > error: '#include ' attaches the declarations to the named module > '.get', which is not usually intended; consider moving that

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread David Blaikie via cfe-commits
dwblaikie wrote: FWIW, we saw failures at Google (where, to the best of my knowledge, we aren't using named modules at all) that look like this: ``` error: '#include ' attaches the declarations to the named module '.get', which is not usually intended; consider moving that directive before

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Got it. Thanks. Then I feel this is ready to land. https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Michael Spencer via cfe-commits
Bigcheese wrote: This is fine, it's definitely wrong to include framework headers like this too. https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-11-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to land this next week if no objection comes in. Since the `frameworks` looks not intended to be the places too. https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @Bigcheese ping https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69555 >From 86663a35a7af039f9440af2cc1896e8b4cf33310 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 19 Oct 2023 11:28:01 +0800 Subject: [PATCH 1/3] [C++20] [Modules] Warn if we found #include in module

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff b858309ddc977d5e70de54f3fa3888915b5fbc0c 49ead327fec98f5276a9667414668a05fb03c705 --

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > (in this context) Framework headers are like system (or user headers) but > searched by a different mechanism (so they are #include-ed). In principle, > the same constraints should apply - indicates a "system" > header and probably should not be included in the module

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< +

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69555 >From 86663a35a7af039f9440af2cc1896e8b4cf33310 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 19 Oct 2023 11:28:01 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Warn if we found #include in module

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Iain Sandoe via cfe-commits
https://github.com/iains edited https://github.com/llvm/llvm-project/pull/69555 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Iain Sandoe via cfe-commits
iains wrote: > > When I suggested this, it was an intention to limit it to C++ std library > > headers. Do we not have some existing mechanism that knows which headers > > are in this category (for typo correction etc?) > > As far as I can reach, we don't have such a mechanism. Ah, that's

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Iain Sandoe via cfe-commits
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< +

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > When I suggested this, it was an intention to limit it to C++ std library > headers. Do we not have some existing mechanism that knows which headers are > in this category (for typo correction etc?) As far as I can reach, we don't have such a mechanism. I was wondering if

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Chuanqi Xu via cfe-commits
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< +

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Iain Sandoe via cfe-commits
https://github.com/iains commented: When I suggested this, it was an intention to limit it to C++ std library headers. Do we not have some existing mechanism that knows which headers are in this category (for typo correction etc?) My concern with making it more general is that it then covers

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-19 Thread Iain Sandoe via cfe-commits
@@ -922,6 +922,10 @@ def err_header_import_semi_in_macro : Error< def err_header_import_not_header_unit : Error< "header file %0 (aka '%1') cannot be imported because " "it is not known to be a header unit">; +def warn_pp_include_angled_in_module_purview : Warning< +

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/69555 >From 86663a35a7af039f9440af2cc1896e8b4cf33310 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 19 Oct 2023 11:28:01 +0800 Subject: [PATCH] [C++20] [Modules] Warn if we found #include in module purview

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-18 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chuanqi Xu (ChuanqiXu9) Changes Close https://github.com/llvm/llvm-project/issues/68615. It is generally wrong to include filename in the module purview. Although there are cases to include files in the module purview, generally these

[clang] [C++20] [Modules] Warn if we found #include in module purview (PR #69555)

2023-10-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/69555 Close https://github.com/llvm/llvm-project/issues/68615. It is generally wrong to include in the module purview. Although there are cases to include files in the module purview, generally these use cases