public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40311]  New: brace initialization does not work well with new
@ 2009-05-30 15:16 public at alisdairm dot net
  2009-06-02 17:03 ` [Bug c++/40311] " jason at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: public at alisdairm dot net @ 2009-05-30 15:16 UTC (permalink / raw)
  To: gcc-bugs

Tested on MinGW 4.4.0

The following code does not compile and should:

int main()
{
   int * a = new int{};
   int * b = new int{5};
   return 0;
}


Compiler output:
main.cpp||In function 'int main()':|
main.cpp|3|error: aggregate value used where an integer was expected|
main.cpp|4|error: aggregate value used where an integer was expected|
main.cpp|3|warning: unused variable 'a'|
main.cpp|4|warning: unused variable 'b'|
||=== Build finished: 2 errors, 2 warnings ===|


-- 
           Summary: brace initialization does not work well with new
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: public at alisdairm dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40311


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-03 18:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-30 15:16 [Bug c++/40311] New: brace initialization does not work well with new public at alisdairm dot net
2009-06-02 17:03 ` [Bug c++/40311] " jason at gcc dot gnu dot org
2009-06-02 20:15 ` jason at gcc dot gnu dot org
2009-06-03 18:12 ` jason at gcc dot gnu dot 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).