ChuanqiXu added a comment.

In D128328#3603945 <https://reviews.llvm.org/D128328#3603945>, @iains wrote:

> In D128328#3603942 <https://reviews.llvm.org/D128328#3603942>, @ChuanqiXu 
> wrote:
>
>> In D128328#3603940 <https://reviews.llvm.org/D128328#3603940>, @iains wrote:
>>
>>> In D128328#3602646 <https://reviews.llvm.org/D128328#3602646>, @iains wrote:
>>>
>>>> In D128328#3601080 <https://reviews.llvm.org/D128328#3601080>, @ChuanqiXu 
>>>> wrote:
>>>>
>>>>> It looks like we need to handle inline variable as well to match the 
>>>>> intention.
>>>>
>>>> can you construct a test-case, where this would apply and which is not 
>>>> already diagnosed as incorrect?
>>>
>>> Did you have some ideas here?
>>
>> The test may be something like:
>>
>>   export module A;
>>   inline int a;
>>   module :private
>>   int a = 0; // expected-error 
>
> but we reject this at the moment with "redefinition of 'a'" - so that implies 
> we do not have fully correct C++17 handling here?

Sorry, my bad. The configuration of my godbolt was wrong (The input is LLVM 
IR). I feel like the following one should be the test case:

  export module A;
  [export] inline int a;

Here the inline variable 'a' is declared in the definition domain but not 
defined. This violates [dcl.inline]p7:

> If an inline function or variable that is attached to a named module is 
> declared in a definition domain, it shall be defined in that domain.

Also, **if** [module.private.frag]p2.1 is changed into:

> the point by which the definition of an [exported] inline function or 
> variable is required

The test above would test this too.

BTW, it shows we could lack test like:

  export module A;
  [export] inline void func(); // no definition in the definition domain

The meaning of [export] depends on the result of the feedback from WG21.

>> But I feel like we couldn't  go on before we get response from WG21.
>
> Agreed, and anyway I think we would want to add a new test case, not to amend 
> the example from the std (otherwise that becomes confusing as well)




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128328/new/

https://reviews.llvm.org/D128328

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to