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

Bug 333599

Summary: [C++0x] Initializer lists & return without type
Product: [Tools] CDT Reporter: trashyankes
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle, yevshif, zeratul976
Version: 8.0   
Target Milestone: 8.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix
cdtdoug: iplog+
test case cdtdoug: iplog+

Description trashyankes CLA 2011-01-05 14:50:19 EST
i get parse error on this C++0x code

vector<int> ret()
{
	return {1,3,3};//error: "Return without value, in function returning non-void"
};

when i add "vector<int>" after return, parser stop showing error
both version work under MinGW 4.5

-- Configuration Details --
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.cpp.product)
Installed Features:
 org.eclipse.platform 3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L
Comment 1 Elena Laskavaia CLA 2011-01-17 22:46:21 EST
how do make cdt to understand this as c++0x in a first place? Any special settings?
Comment 2 Markus Schorn CLA 2011-01-18 04:57:46 EST
(In reply to comment #1)
> how do make cdt to understand this as c++0x in a first place? Any special
> settings?
You don't need a special setting, the parser accepts c++0x (as far as we support it) per default.
Comment 3 Tomasz Wesolowski CLA 2011-06-16 12:00:45 EDT
Created attachment 198128 [details]
Fix

My smallest patch ever, I think :)
Comment 4 Elena Laskavaia CLA 2011-06-27 22:12:54 EDT
test is missing
Comment 5 Tomasz Wesolowski CLA 2011-07-01 08:13:22 EDT
Created attachment 198958 [details]
test case
Comment 6 Elena Laskavaia CLA 2011-07-15 21:15:06 EDT
patch applied, thanks
Comment 7 CDT Genie CLA 2011-07-15 21:20:16 EDT
*** cdt git genie on behalf of 333599 ***

    Bug 333599 - [C++0x] Initializer lists & return without type

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=85d105d4f5aeea421f46aac0d5213051c1b1d050
Comment 8 CDT Genie CLA 2011-07-15 21:20:18 EDT
*** cdt git genie on behalf of 333599 ***

    Bug 333599 - [C++0x] Initializer lists & return without type

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=761ccb9301f63f439aad89ef060775369ef917a0
Comment 9 Marc-André Laperle CLA 2011-07-25 15:09:11 EDT
*** Bug 352924 has been marked as a duplicate of this bug. ***