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

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-05-22 10:22:38 -07:00
parent 20e43a2744
commit 724e1991ac
2 changed files with 8 additions and 7 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2012 Anton Gorenkov and others
* Copyright (c) 2011, 2013 Anton Gorenkov and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -249,7 +249,7 @@ public class ClassMembersInitializationChecker extends AbstractIndexAstChecker {
}
/** Checks that specified declaration is a class constructor
* (it is a class member and its name is equal to class name)
* (it is a class member and its name is equal to the class name)
*/
private ICPPConstructor getConstructor(IASTDeclaration decl) {
if (decl instanceof ICPPASTFunctionDefinition) {
@ -270,10 +270,11 @@ public class ClassMembersInitializationChecker extends AbstractIndexAstChecker {
if (memberName != null) {
IBinding memberBinding = memberName.resolveBinding();
ICPPClassType classType = null;
if (memberBinding instanceof ICPPClassType)
if (memberBinding instanceof ICPPClassType) {
classType = (ICPPClassType) memberBinding;
else if (memberBinding instanceof ICPPConstructor)
} else if (memberBinding instanceof ICPPConstructor) {
classType = ((ICPPConstructor) memberBinding).getClassOwner();
}
if (classType != null && classType.isSameType(constructor.getClassOwner()))
return null;
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2012 Anton Gorenkov and others
* Copyright (c) 2011, 2013 Anton Gorenkov and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -606,7 +606,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// struct A {
// A(int n) : waldo(n) {}
// A() : A(42) {} // warning: "Member 'waldo' was not initialized in this constructor"
// A() : A(42) {}
// int waldo;
// };
public void testBug402607_delegatingConstructor() throws Exception {
@ -617,7 +617,7 @@ public class ClassMembersInitializationCheckerTest extends CheckerTestCase {
// struct A {
// typedef A B;
// A(int n) : waldo(n) {}
// A() : B(42) {} // warning: "Member 'waldo' was not initialized in this constructor"
// A() : B(42) {}
// int waldo;
// };
public void testBug402607_delegatingConstructorTypedef() throws Exception {