Annex G (informative)
Ill-formed, no diagnostic required
[ifndr]
G.8
[class]
: Classes
[ifndr.class]
G.8.1
[ifndr:class.base.init.delegate.itself]
Specified in:
[class.
base.
init]
1
#
If a constructor delegates to itself directly or indirectly, the program is ill-formed, no diagnostic required
2
#
[
Example
1
:
struct
C
{
C
(
int
)
{
}
// #1: non-delegating constructor
C
(
)
:
C
(
42
)
{
}
// #2: delegates to #1
C
(
char
c
)
:
C
(
42.0
)
{
}
// #3: IFNDR due to recursion with #4
C
(
double
d
)
:
C
(
'a'
)
{
}
// #4: IFNDR due to recursion with #3
}
;
—
end example
]