Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323972 - Formatting issue with #define
Summary: Formatting issue with #define
Status: RESOLVED WORKSFORME
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-30 10:30 EDT by BB CLA
Modified: 2019-04-13 02:56 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BB CLA 2010-08-30 10:30:35 EDT
I found a formatting issue.
Copy the following code into the C++ Editor and press (ctrl+shift+f). 


#include <iostream>
#include <string>

//#define OUTPUT_STREAM std::cout
#define OUTPUT_STREAM true && std::cout

int main(int argc, char **argv) {
	OUTPUT_STREAM << "test" << std::endl;
	// This line moves
	// This line moves
} // This line moves


The result after the formatting is not well and looks like this:

#include <iostream>
#include <string>

//#define OUTPUT_STREAM std::cout
#define OUTPUT_STREAM true && std::cout

int main(int argc, char **argv) {
	OUTPUT_STREAM << "test" << std::endl;
	// This line moves
			// This line moves
		} // This line moves


If I comment out the second define and uncomment the first define, the formatting looks good:

#include <iostream>
#include <string>

#define OUTPUT_STREAM std::cout
//#define OUTPUT_STREAM true && std::cout

int main(int argc, char **argv) {
	OUTPUT_STREAM << "test" << std::endl;
	// This line moves
	// This line moves
} // This line moves
Comment 1 Marco Stornelli CLA 2019-04-13 02:38:43 EDT
This bug report should be closed because we can't reproduce with CDT 9.7.