alexfh wrote:

It looks like this commit introduces an undesired false-positive: 
https://gcc.godbolt.org/z/rEjzK63he

```
struct P {
  int a [[clang::require_explicit_initialization]];
};

struct S {
  P p;
  S(P p) : p(p) {}
};
```

```
<source>:7:12: warning: field in 'P' requires explicit initialization but is 
not explicitly initialized [-Wuninitialized-explicit-init]
    7 |   S(P p) : p(p) {}
      |            ^
<source>:2:7: note: 'a' declared here
    2 |   int a [[clang::require_explicit_initialization]];
      |       ^
```

I don't think it's helpful to warn about not explicitly initializing a field on 
copy or move.

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

Reply via email to