Issue |
131745
|
Summary |
[clang] -Wunique-object-duplication in static class member functions, intentional?
|
Labels |
clang:frontend
|
Assignees |
|
Reporter |
carlosgalvezp
|
Hi,
We are getting hits of the -Wunique-object-duplication warning in this type of code:
```cpp
struct Foo
{
Foo& get()
{
static Foo f{}; // -Wunique-object-duplication
return f;
}
};
```
Example: https://godbolt.org/z/qnKrEnh1d
I did not see this use case in the unit tests, so I wonder if warning here is intentional?
Thanks!
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs