Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352924

Summary: Parser gives error for initializer-list return
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: CLOSED DUPLICATE QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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 ***