dblaikie added a comment.

In D102356#2761010 <https://reviews.llvm.org/D102356#2761010>, @hoy wrote:

> In D102356#2760973 <https://reviews.llvm.org/D102356#2760973>, @dblaikie 
> wrote:
>
>> In D102356#2758371 <https://reviews.llvm.org/D102356#2758371>, @hoy wrote:
>>
>>> In D102356#2758179 <https://reviews.llvm.org/D102356#2758179>, @dblaikie 
>>> wrote:
>>>
>>>> This was previously crashing, I guess? Testing should validate the 
>>>> behavior beyond the crash, though - (presumably there's some more specific 
>>>> behavior than "does not crash" that wasn't being tested for before - that 
>>>> certain names are mangled appropriately or what-have-you)
>>>
>>> Yes, an assert was triggered related to c++ constructors/destructors while 
>>> it's not now. Regarding the behavior, c++ constructors/destructors are not 
>>> static, so I don't expect a behavior change.
>>
>> ctors/dtors can have internal linkage, if the type has internal linkage (if 
>> it's in an anonymous namespace) - but in any case, my point was that there's 
>> some specific behavior you're expecting, even if that behavior is "does not 
>> get this attribute" - previously no code tested that with this feature 
>> enabled the ctor wouldn't get the attribute (because it couldn't've tested 
>> that, because what it did was crash) - so testing that would be good.
>>
>> But testing the attribute does work on the ctor of a type in an anonymous 
>> namespace would be suitable too.
>
> Good to know that ctors/dtors can have internal linkage. How do you get that? 
> The C++ standard doesn't allow ctors to be static.

Placing the type within an anonymous namespace should do the trick, something 
like this: https://godbolt.org/z/8YMWhbWM8


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102356

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

Reply via email to