1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

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

This commit is contained in:
Tomasz Wesolowski 2011-07-15 21:08:11 -04:00 committed by Alena Laskavaia
parent 7c49b1c157
commit 85d105d4f5
2 changed files with 10 additions and 1 deletions

View file

@ -93,7 +93,7 @@ public class ReturnChecker extends AbstractAstFunctionChecker {
public int visit(IASTStatement stmt) { public int visit(IASTStatement stmt) {
if (stmt instanceof IASTReturnStatement) { if (stmt instanceof IASTReturnStatement) {
IASTReturnStatement ret = (IASTReturnStatement) stmt; IASTReturnStatement ret = (IASTReturnStatement) stmt;
boolean hasValue = ret.getReturnValue() != null; boolean hasValue = ret.getReturnArgument() != null;
if (hasret == false && hasValue) { if (hasret == false && hasValue) {
hasret = true; hasret = true;
} }

View file

@ -289,4 +289,13 @@ public class ReturnCheckerTest extends CheckerTestCase {
loadCodeAndRunCpp(getAboveComment()); loadCodeAndRunCpp(getAboveComment());
checkNoErrors(); checkNoErrors();
} }
// #include <vector>
// std::vector<int> f() {
// return {1,2,3};
// }
public void testReturnInitializerList() {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
} }