public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97422] New: gcc rejects 'std::initializer_list' when instantiating with a list
@ 2020-10-14 14:06 tangyixuan at mail dot dlut.edu.cn
2020-10-14 16:59 ` [Bug c++/97422] " mpolacek at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: tangyixuan at mail dot dlut.edu.cn @ 2020-10-14 14:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97422
Bug ID: 97422
Summary: gcc rejects 'std::initializer_list' when instantiating
with a list
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tangyixuan at mail dot dlut.edu.cn
Target Milestone: ---
Hi, when instantiating a function with a list of integer type, gcc rejects it
and reports two duplicate error messages. Clang accepts.
$ cat s.cpp
#include <initializer_list>
void func( std::initializer_list<int[1]> list) {}
int main()
{
func( {{1},{2},{3}} );
}
$ g++ -c s.cpp
s.cpp: In function ‘int main()’:
s.cpp:6:24: error: array must be initialized with a brace-enclosed initializer
6 | func( {{1},{2},{3}} );
| ^
s.cpp:6:24: error: array must be initialized with a brace-enclosed initializer
s.cpp:6:24: error: array must be initialized with a brace-enclosed initializer
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/97422] gcc rejects 'std::initializer_list' when instantiating with a list
2020-10-14 14:06 [Bug c++/97422] New: gcc rejects 'std::initializer_list' when instantiating with a list tangyixuan at mail dot dlut.edu.cn
@ 2020-10-14 16:59 ` mpolacek at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-14 16:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97422
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
CC| |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like a dup.
*** This bug has been marked as a duplicate of bug 71424 ***
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-14 16:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 14:06 [Bug c++/97422] New: gcc rejects 'std::initializer_list' when instantiating with a list tangyixuan at mail dot dlut.edu.cn
2020-10-14 16:59 ` [Bug c++/97422] " mpolacek at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).