Community
Participate
Working Groups
Consider following example: x.hpp: namespace ns { void fun(); } x.cpp: #include "x.hpp" namespace alias = ns; void alias::fun() {} "alias::fun" is generating codan warning "Member declaration not found". F3 navigates to the definition in the header but not back. If I move namespace definition inside x.cpp everything starts working.
Added testcase and fix.
*** cdt git genie on behalf of Markus Schorn *** Bug 356493: Namespace alias in qualified name. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0cbcce913fe550e2de7ab8ba5635da73d95f2f8c
Thanks for looking at it that soon but after this change an exception is thrown at following snippet after any change in the file: template <typename T> void f() { typename T::type t; } java.lang.ClassCastException: org.eclipse.cdt.internal.core.dom.parser.cpp.CPPUnknownScope cannot be cast to org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getOwnMethods(ClassTypeHelper.java:320) at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.collectPureVirtualMethods(ClassTypeHelper.java:874) at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getPureVirtualMethods(ClassTypeHelper.java:823) at org.eclipse.cdt.codan.internal.checkers.AbstractClassInstantiationChecker$OnEachClass.reportProblemsIfAbstract(AbstractClassInstantiationChecker.java:195) at org.eclipse.cdt.codan.internal.checkers.AbstractClassInstantiationChecker$OnEachClass.checkClass(AbstractClassInstantiationChecker.java:120) at org.eclipse.cdt.codan.internal.checkers.AbstractClassInstantiationChecker$OnEachClass.visit(AbstractClassInstantiationChecker.java:90) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration.accept(CPPASTSimpleDeclaration.java:89) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarationStatement.accept(CPPASTDeclarationStatement.java:72) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:79) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:187) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTemplateDeclaration.accept(CPPASTTemplateDeclaration.java:119) at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:279) at org.eclipse.cdt.codan.internal.checkers.AbstractClassInstantiationChecker.processAst(AbstractClassInstantiationChecker.java:66) at org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker.processModel(AbstractIndexAstChecker.java:103) at org.eclipse.cdt.codan.internal.core.CodanBuilder.processResource(CodanBuilder.java:149) at org.eclipse.cdt.codan.internal.core.CodanBuilder.runInEditor(CodanBuilder.java:218) at org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanReconciler.reconciledAst(CxxCodanReconciler.java:38) at org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler.reconciled(CodanCReconciler.java:81) at org.eclipse.cdt.internal.ui.editor.CEditor.reconciled(CEditor.java:3196) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:108) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:73) at org.eclipse.cdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:84) at org.eclipse.cdt.internal.ui.text.CCompositeReconcilingStrategy.reconcile(CCompositeReconcilingStrategy.java:90) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.cdt.internal.ui.text.CReconciler.process(CReconciler.java:408) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
(In reply to comment #3) > Thanks for looking at it that soon but after this change an exception is thrown > at following snippet after any change in the file: See bug 356239.
(In reply to comment #3) As Marc-Andre pointed out, this is a different issue.
*** cdt git genie on behalf of Markus Schorn *** Bug 356493: Namespace alias in qualified name. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=aa6c2c50d0a58928d81a576e29a3fae50d2c3e5f