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:
parent
7c49b1c157
commit
85d105d4f5
2 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue