Bug 418479 - IllegalArgumentException on template alias member of template class
Summary: IllegalArgumentException on template alias member of template class
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.3.0   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 8.3.0   Edit
Assignee: Sergey Prigogin CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-02 05:13 EDT by Michael Woski CLA
Modified: 2013-10-02 17:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Woski CLA 2013-10-02 05:13:36 EDT
Hi,

as I've already mentioned in Bug #414450 I suspect that the bugfix has introduced a new issue. When I try to use code assist an Exception gets thrown.
When you look at the example code below, the problem arises whenever C is a class template, a normal class is not hit by the bug. Further, the exception is only thrown when at least one template alias is declared inside C; remove declaration of E and everything is fine again.

>>>>> Example Code <<<<<<

struct A {};

template<typename _T_>
struct B {};

template<typename _A_>
struct C {

	using D = _A_;

	template<typename _T_>
	using E = B<_T_>;		// this is causing the trouble

};

void test() {
	C<A>:: 	// <-- outch, throws exception shown below
}

>>>>> Exception <<<<<<

java.lang.IllegalArgumentException: E is not a member of C
	at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.invalidMember(ClassTypeHelper.java:1007)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getVisibility(ClassTypeHelper.java:923)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate.getVisibility(CPPClassTemplate.java:257)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.AccessContext.isAccessible(AccessContext.java:93)
	at org.eclipse.cdt.internal.ui.text.contentassist.DOMCompletionProposalComputer.computeCompletionProposals(DOMCompletionProposalComputer.java:144)
	at org.eclipse.cdt.internal.ui.text.contentassist.ParsingBasedProposalComputer.computeCompletionProposals(ParsingBasedProposalComputer.java:56)
	at org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:294)
	at org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:261)
	at org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:275)
	at org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:228)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1839)
....
Comment 2 CDT Genie CLA 2013-10-02 17:22:04 EDT
*** cdt git genie on behalf of Sergey Prigogin ***

    Bug 418479 - IllegalArgumentException on template alias member of
    template class

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=19db352cb98a7ae83f4e817dbf88fe93683bfe44