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

Bug 364534

Summary: Indentation for switch statement with comma in macro expansion
Product: [Tools] CDT Reporter: Roland Schulz <roland>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: RESOLVED WORKSFORME QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif, zeratul976
Version: 8.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Roland Schulz CLA 2011-11-23 00:20:50 EST
For the following code:

void f(int a, int b, char* s, int t) {
}

#define FARGS 0,1

void g(int d, int type) {
	switch (d) {
	case 0:
		f(FARGS, "", type);
		break;
	case 1:
		break;
	}
}

Format indents "case 1" by one additional level. Without the comma in the macro definition the indentation is correct. It is also correct without the macro usage. Also "Source->Correct Indentation" indents it correctly. Only "Source->Format" indents it incorrectly together with this macro.

Reproducible: Always
Comment 1 Nathan Ridge CLA 2015-07-23 20:59:52 EDT
I can't reproduce this issue. Do you still see it?
Comment 2 Nathan Ridge CLA 2016-12-29 18:26:36 EST
Closing per comment 1. Feel free to reopen if you're still seeing this.