<div class="__aliyun_email_body_block"><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">Hi</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">>> Personally, I think this was an oversight. It seems to me that trying<br >>> to be in both modules modes at the same time is not something we want<br >>> to support, so I'd be in favor of treating these as mutually exclusive<br >>> options and the user gets an error if they try.<br >>> <br >>> ~Aaron</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">---</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">   I think so that we could avoid to support two modes at the same time. Another problem is that what's the behavior if user enabled '-std=c++20' and '-fmodules'.</span></div><div  style="clear:both;">I think an error may not be friendly enough since people may want to use other feature in C++20 and clang module. I wonder if it would be better when "-std=c++20"</div><div  style="clear:both;">and "-fmodules" occur at the same time, the compiler should emit a warning and disable c++20 modules by settting `<span  style="caret-color:#000000;color:#000000;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;font-style:normal;font-variant-caps:normal;font-weight:normal;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration:none;float:none;display:inline;">CPlusPlusModules</span>` to false. What's your opinion?</div><div  style="clear:both;"><br ></div><div  style="clear:both;">Thanks,</div><div  style="clear:both;">Chuanqi</div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div><blockquote  style="margin-right:0;margin-top:0;margin-bottom:0;"><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">------------------------------------------------------------------</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">From:Aaron Ballman <aaron@aaronballman.com></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">Send Time:2021年11月3日(星期三) 20:34</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">To:chuanqi.xcq <yedeng.yd@linux.alibaba.com></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">Cc:Clang Dev <cfe-dev@lists.llvm.org>; David Blaikie <dblaikie@gmail.com>; Richard Smith <richard@metafoo.co.uk>; Nathan Sidwell <nathan@acm.org>; "Keane, Erich" <erich.keane@intel.com></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;">Subject:Re: [cfe-dev] What's the case if clang module and c++20 module are enabled at the same time?</span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><br ></span></div>On Wed, Nov 3, 2021 at 7:51 AM chuanqi.xcq via cfe-dev<br ><cfe-dev@lists.llvm.org> wrote:<br >><br >> Hi,<br >><br >>    Recently I am developing C++20 semantics in clang. Then I met an interesting bug in<br >> compare-modules-cxx2a.cpp (https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/compare-modules-cxx2a.cpp).<br >><br >>     The key point here is that the test uses `-std=c++2a` and `-fmodules` both. So my codes which is intended to work for C++20 module now tests for clang module. So here is the reason for the bug.<br >><br >>     Beyond my personal work, it is weired for me that we could use clang module and c++20 module at the same time. (I know the implementation of c++20 is based on clang module).<br >> So I want to ask: do we have considered the case that we use clang module and c++20 module together? Is it neceesary? And what's the status after the user enable c++20 module and clang module?<br >><br >>     For example, when we enter "clang -std=c++20 -fprebuilt-module-path=%t %s -c" to the command line, both `getLangOpts().CPlusPlusModules` and `getLangOpts().Modules` would evaluate to true, which is really weired.<br >> Is it intentional? Or is it a bug simply? Now I couldn't avoid the bug by `if (getLangOpts().CPlusPlusModules && !getLangOpts().Modules)`.<br ><br >Personally, I think this was an oversight. It seems to me that trying<br >to be in both modules modes at the same time is not something we want<br >to support, so I'd be in favor of treating these as mutually exclusive<br >options and the user gets an error if they try.<br ><br >~Aaron<br ><br >><br >>     I CCed people who looks like interested and related. Remind me if you feel uncomfortable.<br >><br >> Thanks,<br >> Chuanqi<br >> _______________________________________________<br >> cfe-dev mailing list<br >> cfe-dev@lists.llvm.org<br >> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</blockquote><div ><br ></div></div>