diff options
author | Sergey Prigogin | 2009-01-25 04:13:08 +0000 |
---|---|---|
committer | Sergey Prigogin | 2009-01-25 04:13:08 +0000 |
commit | 1805f2368d85aa8baf22f76efc09c5d7f35a8f1c (patch) | |
tree | c94bb41141d70128fe3403cfcba51fe31c084d13 /core/org.eclipse.cdt.core | |
parent | 82dbef1ccc38258d06d7b0318b8c5a3f228a9ff0 (diff) | |
download | org.eclipse.cdt-1805f2368d85aa8baf22f76efc09c5d7f35a8f1c.tar.gz org.eclipse.cdt-1805f2368d85aa8baf22f76efc09c5d7f35a8f1c.tar.xz org.eclipse.cdt-1805f2368d85aa8baf22f76efc09c5d7f35a8f1c.zip |
Fixed an NPE.
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r-- | core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java index 17234747ee5..64007fb5c3c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java @@ -1336,11 +1336,11 @@ public class CPPSemantics { IASTDeclarator[] declarators = simpleDeclaration.getDeclarators(); IScope dtorScope= scope; if (declSpec.isFriend()) { - // friends are added to an enclosing scope. They have to be added such that they are + // Friends are added to an enclosing scope. They have to be added such that they are // picked up when this scope is re-populated during ambiguity resolution, while the // enclosing scope is left as it is. try { - while (dtorScope.getKind() == EScopeKind.eClassType) + while (dtorScope != null && dtorScope.getKind() == EScopeKind.eClassType) dtorScope= dtorScope.getParent(); } catch (DOMException e) { dtorScope= null; @@ -1374,14 +1374,14 @@ public class CPPSemantics { ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) declSpec; specName = compSpec.getName(); - // anonymous union or struct (GCC supports anonymous structs too) + // Anonymous union or struct (GCC supports anonymous structs too) if (declarators.length == 0 && specName.getLookupKey().length == 0) { IASTDeclaration[] decls = compSpec.getMembers(); for (IASTDeclaration decl : decls) { populateCache(scope, decl); } } else { - // collect friends enclosed in nested classes + // Collect friends enclosed in nested classes switch (scope.getKind()) { case eLocal: case eGlobal: @@ -1396,7 +1396,7 @@ public class CPPSemantics { IASTEnumerationSpecifier enumeration = (IASTEnumerationSpecifier) declSpec; specName = enumeration.getName(); - // check enumerators too + // Check enumerators too IASTEnumerator[] list = enumeration.getEnumerators(); IASTName tempName; for (IASTEnumerator enumerator : list) { |