hubert-reinterpretcast wrote:

> The manual change says "the TOC data transformation will be applied to [...] 
> block-scope static variables". But later, you mention "internal linkage", 
> which is a bit confusing when you're dealing with C++. Block-scope static 
> variables don't have "linkage" in the sense defined in the C++ standard. 
> Maybe worth trying to be more explicit here.

The later mention of "internal linkage" is with respect to not being able to 
apply the transformation to variables with internal linkage. This is consistent 
with block-scope static variables not having "linkage" as defined by the C++ 
standard. @efriedma-quic

Nevertheless, the other mention of "internal linkage" (which states that the 
explicit naming forms ignore such variables) may also require the addition of 
"block-scope static variables". @syzaara

My understanding is that trying to name the `x` below using 
`-mtocdata=_ZZ3foovE1x` is not effective:
```cpp
inline int foo [[gnu::used]]() {
  static int x = 0;
  return ++x;
}
```

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

Reply via email to