<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  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;">Aaron,</span></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><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;"><br ></span></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><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;">   Your suggestion makes sense. I have posted a issue here: https://bugs.llvm.org/show_bug.cgi?id=52413.</span></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><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;">It would be great if someone who is more familiar with clang driver would love to fix it.</span></span></div><div  style="clear:both;">If others are busy, I would try to fix it. I guess it might not be so hard to implement?</div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><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;"><br ></span></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><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;">Thanks,</span></span></div><div  style="clear:both;"><span  style="font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><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;">Chuanqi</span></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月4日(星期四) 21:21</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 10:00 PM chuanqi.xcq <yedeng.yd@linux.alibaba.com> wrote:<br >><br >> Hi<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 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'.<br >> I think an error may not be friendly enough since people may want to use other feature in C++20 and clang module.<br ><br >Personally, I don't consider that to be a valid use case. If the user<br >wants C++20, they get modules because that's what it means to compile<br >against C++20<br ><br >> I wonder if it would be better when "-std=c++20"<br >> and "-fmodules" occur at the same time, the compiler should emit a warning and disable c++20 modules by settting `CPlusPlusModules` to false. What's your opinion?<br ><br >I think I'd feel more comfortable if the user had to explicitly opt<br >*out* of the C++20 feature. e.g., `clang -std=c++20 -fno-cxx-modules<br >-fmodules` (though if we went this route, it might be a kindness to<br >consider renaming -fmodules to -fclang-modules). We have a similar<br >relationship with exceptions -- you get them by default, but you can<br >opt out of them if you need to (or opt into other exception models).<br ><br >~Aaron<br ><br >><br >> Thanks,<br >> Chuanqi<br >><br >><br >><br >> ------------------------------------------------------------------<br >> From:Aaron Ballman <aaron@aaronballman.com><br >> Send Time:2021年11月3日(星期三) 20:34<br >> To:chuanqi.xcq <yedeng.yd@linux.alibaba.com><br >> 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><br >> Subject:Re: [cfe-dev] What's the case if clang module and c++20 module are enabled at the same time?<br >><br >> 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<br >><br >></blockquote><div ><br ></div></div>