зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1453795 - MFTB - Initialize member fields in classes/ structures. r=waldo
--HG-- extra : rebase_source : e091acb3a9f60695b87ab9e3d348c5978680d2f8
This commit is contained in:
Родитель
be47373507
Коммит
4a5d0dd615
|
@ -33,13 +33,27 @@ INSTANTIATE(int, int, prim1, 2 * sizeof(int));
|
||||||
INSTANTIATE(int, long, prim2, 2 * sizeof(long));
|
INSTANTIATE(int, long, prim2, 2 * sizeof(long));
|
||||||
|
|
||||||
struct EmptyClass { explicit EmptyClass(int) {} };
|
struct EmptyClass { explicit EmptyClass(int) {} };
|
||||||
struct NonEmpty { char mC; explicit NonEmpty(int) {} };
|
struct NonEmpty
|
||||||
|
{
|
||||||
|
char mC;
|
||||||
|
explicit NonEmpty(int)
|
||||||
|
: mC('\0')
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
INSTANTIATE(int, EmptyClass, both1, sizeof(int));
|
INSTANTIATE(int, EmptyClass, both1, sizeof(int));
|
||||||
INSTANTIATE(int, NonEmpty, both2, 2 * sizeof(int));
|
INSTANTIATE(int, NonEmpty, both2, 2 * sizeof(int));
|
||||||
INSTANTIATE(EmptyClass, NonEmpty, both3, 1);
|
INSTANTIATE(EmptyClass, NonEmpty, both3, 1);
|
||||||
|
|
||||||
struct A { char dummy; explicit A(int) {} };
|
struct A
|
||||||
|
{
|
||||||
|
char dummy;
|
||||||
|
explicit A(int)
|
||||||
|
: dummy('\0')
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
struct B : A { explicit B(int aI) : A(aI) {} };
|
struct B : A { explicit B(int aI) : A(aI) {} };
|
||||||
|
|
||||||
INSTANTIATE(A, A, class1, 2);
|
INSTANTIATE(A, A, class1, 2);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче