Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352924 - Parser gives error for initializer-list return
Summary: Parser gives error for initializer-list return
Status: CLOSED DUPLICATE of bug 333599
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-23 00:24 EDT by Nathan Ridge CLA
Modified: 2011-07-25 15:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Ridge CLA 2011-07-23 00:24:48 EDT
The parser gives the error "Return without value, in function returning non-void" for the following code:

struct S
{
    int a;
    double b;
};

S foo()
{
    return {0, 0.0};  // ERROR HERE
}

This is valid C++0x and is accepted by gcc since version 4.4.
Comment 1 Marc-André Laperle CLA 2011-07-25 15:09:11 EDT
This was fixed in 8.0.1 and master > 20110715, see bug 333599.

*** This bug has been marked as a duplicate of bug 333599 ***