Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333599 - [C++0x] Initializer lists & return without type
Summary: [C++0x] Initializer lists & return without type
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 8.0.1   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
: 352924 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-05 14:50 EST by trashyankes CLA
Modified: 2014-01-29 22:46 EST (History)
4 users (show)

See Also:


Attachments
Fix (961 bytes, patch)
2011-06-16 12:00 EDT, Tomasz Wesolowski CLA
cdtdoug: iplog+
Details | Diff
test case (1.02 KB, patch)
2011-07-01 08:13 EDT, Tomasz Wesolowski CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***