This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 250831 - Wrong formatting of brace-initialized constructor initializerlists
Summary: Wrong formatting of brace-initialized constructor initializerlists
Status: RESOLVED DUPLICATE of bug 246062
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P4 normal with 1 vote (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-02 17:37 UTC by etrof
Modified: 2015-03-02 17:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description etrof 2015-03-02 17:37:25 UTC
Brace-initialized initializerlists – as supported since C++11 – are malformed. The expected behavior is as for old ( ) initialization.

Example:

class Example
{
public:
    Example(int a) : m_value{a} // Initialization using { }
    {
        /* Ctor body */
    }

private:
    int m_value;
};

Using auto format breaks the formatting:

    Example(int a) : m_value
    {
        a 
    }
    {
        /* Ctor body */
    }

The m_value{a} is separated into new lines.

Using normal ( ) for initializer lists – m_value(a) – works fine.
Comment 1 etrof 2015-03-02 17:45:28 UTC
Existing issue found (to late ...).

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