Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359653 - 'auto' typing with ranged-based for loop
Summary: 'auto' typing with ranged-based for loop
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 8.0.2   Edit
Assignee: Markus Schorn CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-02 04:22 EDT by Jean-Paul RIGAULT CLA
Modified: 2011-10-06 11:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Paul RIGAULT CLA 2011-10-02 04:22:09 EDT
When editing this code

	vector<int> v = { 1, 2, 3 };
	for (auto e : v) {
		std::cout << e << std::endl;
	}

I got 'endl' underlined in red with the error message "Invalid overload of 'endl'" (which of course makes no sense). 

If I replace 'auto' by 'int', there is no error. Besides, when 'auto' is not used in a ranged-based for loop (including regular for loop), everything is fine.


-- Configuration Details --
Product: Eclipse 1.4.1.20110909-0613 (org.eclipse.epp.package.cpp.product)
Installed Features:
 org.eclipse.platform 3.7.1.r37x_v20110729-9gF7UHOxFtniV7mI3T556iZN9AU8bEZ1lHMcVK
Comment 1 Markus Schorn CLA 2011-10-06 10:08:20 EDT
Implementation for auto-types in range-based for loops (bug 332883) was incomplete. Added testcase and fix.
Comment 2 CDT Genie CLA 2011-10-06 10:23:01 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 359653: Range based for loop with auto type.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0137349b87b20b17dff07ef0285d664199e92bfe
Comment 3 CDT Genie CLA 2011-10-06 11:23:00 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 359653: Range based for loop with auto type.

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=682b3bbf7ba15b748f05a91b61b672051fc940b4