[Bug c++/88517] Virtual-base class class constructor with for-loop with initializer list referencing local variable not executed
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 17 09:14:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88517
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-12-17
Ever confirmed|0 |1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. What happens is that
const int * __for_begin;
<<cleanup_point <<< Unknown tree: expr_stmt
(void) (__for_begin = std::initializer_list<int>::begin ((struct
initializer_list *) __for_range)) >>>>>;
const int * __for_end;
<<cleanup_point <<< Unknown tree: expr_stmt
(void) (__for_end = std::initializer_list<int>::end ((struct initializer_list
*) __for_range)) >>>>>;
while (1)
{
if (__for_begin == __for_end) goto <D.35468>;
^^^^ this is true initially
int i = (int) *__for_begin;
<<cleanup_point <<< Unknown tree: expr_stmt
(void) std::basic_ostream<char>::operator<< ((struct basic_ostream *)
std::basic_ostream<char>::operator<< (&cout, i), endl) >>>>>;
<<cleanup_point (void) ++__for_begin>>;
}
but somehow not when cut&pasting that directly into main().
More information about the Gcc-bugs
mailing list