Commit 10acf5f
committed
[Sema] Note member decl when initializer list default constructs member
Recently I had a scenario where I had:
1. A class C with many members m_1...m_n of the same type T
2. T's default constructor was deleted
3. I accidentally omitted an explicitly constructed member in the
initializer list C() : m_1(foo), m_2(bar), ... { }
Clang told me that T's default constructor was deleted, and told
me that the call to T() was in C() (which it implicitly was), but
didn't tell me which member was being default constructed.
It was difficult to fix this problem because I had no easy way to
list all the members of type T in C and C's superclasses which
would have let me find which member was missing,
clang/test/CXX/class/class.init/p1.cpp is a simplified version
of this problem (a2 is missing from the initializer list of B)1 parent 550d32f commit 10acf5f
File tree
6 files changed
+34
-2
lines changed- clang
- docs
- include/clang/Basic
- lib/Sema
- test
- CXX
- class/class.init
- dcl.decl/dcl.init
- SemaCUDA
6 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
791 | 796 | | |
792 | 797 | | |
793 | 798 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6081 | 6081 | | |
6082 | 6082 | | |
6083 | 6083 | | |
| 6084 | + | |
| 6085 | + | |
6084 | 6086 | | |
6085 | 6087 | | |
6086 | 6088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9088 | 9088 | | |
9089 | 9089 | | |
9090 | 9090 | | |
| 9091 | + | |
| 9092 | + | |
| 9093 | + | |
| 9094 | + | |
| 9095 | + | |
| 9096 | + | |
| 9097 | + | |
| 9098 | + | |
| 9099 | + | |
| 9100 | + | |
| 9101 | + | |
9091 | 9102 | | |
9092 | 9103 | | |
9093 | 9104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
0 commit comments