Community
Participate
Working Groups
My code format is specified to align opening braces after function declarations at the same column, i.e.: int my_function() { return 0; } This works fine, except when the 'noexcept' specifier is added: int my_function() noexcept { return 0; } Possibly related to bug 443042.
Works fine for me with Oxygen.2 / CDT 9.4, and the BSD/Allman formatting profile which has the brace behaviour you describe.
(In reply to Davin McCall from comment #0) > Possibly related to bug 443042. Nor can I reproduce the issue in that bug with CDT 9.4.
Perhaps I should clarify: the format is correct if I run the formatter manually. It is the automatic as-you-type formatting that goes wrong.
(This is with Oxygen.2 and CDT 9.4).
Ah, I see. In that case, I can confirm that I see the same problem. There is a similar problem with 'override' (bug 491296).
Also: seems to happen only with method declarations after some other statement. The first method in a source file (after #include's) is not affected, if nothing precedes it. If I have a "using namespace std;" then a function declaration immediately after that *is* affected.
I've pushed a fix to Gerrit for review: https://git.eclipse.org/r/114832
Fixed for CDT 9.5 (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=fc053e612491385bbd788c216936865b660bb9be). Thanks, Davin!
*** Bug 491296 has been marked as a duplicate of this bug. ***
(In reply to Nathan Ridge from comment #8) > Fixed for CDT 9.5 > (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/ > ?id=fc053e612491385bbd788c216936865b660bb9be). Thanks, Davin! Great! Thanks for your help in pushing this through.
We should uplift this to the 9.4 branch as well, so the fix appears in Oxygen.3 (the current plan is that Oxygen.3 will contain CDT 9.4.1, and Photon will contain CDT 9.5).
Committed on the 9.4 branch in http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?h=cdt_9_4&id=a2930329383f8be84fa9ee74e8c9eef48a30e03c.
(In reply to Nathan Ridge from comment #11) > the current plan is that Oxygen.3 will contain CDT 9.4.1 Correction: 9.4.1 was actually released out-of-band a few days ago, and Oxygen.3 will ship with 9.4.2. The fix for this bug did make it into 9.4.1, so you can get it without waiting for Oxygen.3 by doing "Check for updates" in an Oxygen.2 installation.