philnik777 wrote:

> This is missing test coverage for the interesting cases.
> 
> I'm a bit worried about how easy it will be to apply this attribute in 
> unexpected places. e.g., it will apply to member functions as well as free 
> functions, will anyone expect that though?

This is explicitly documented, so I'd say yes. This is how the pragma works for 
better or worse.

> It also applies to special functions like `main`, though that's more a 
> question of the attribute and less about the pragma.

I'm not sure whether this is a request for a test?

> What's the behavior going to be in C when you get an implicit function 
> declaration in C89 mode? Does that declaration then pick up this attribute as 
> well? How about other special member functions we define on behalf of the 
> user?

I'm not 100% sure what you mean by "define on behalf of users". I've added a 
test for an explicitly defaulted special member. Note though that using 
`#pragma clang attribute` is basically like explicitly defaulting the special 
members and adding the attribute there.

https://github.com/llvm/llvm-project/pull/145653
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to