mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 377838 - Name resolution gets confused by a class and a namespace
with the same name
This commit is contained in:
parent
5ef2d0db02
commit
b6a384b943
2 changed files with 21 additions and 1 deletions
|
@ -4954,7 +4954,24 @@ public class AST2TemplateTests extends AST2BaseTest {
|
|||
tu = validateCopy(tu);
|
||||
assertEquals(1, tu.getDeclarations().length);
|
||||
}
|
||||
|
||||
|
||||
// namespace A {
|
||||
//
|
||||
// template <typename T>
|
||||
// struct A {
|
||||
// A();
|
||||
// };
|
||||
//
|
||||
// template <typename U>
|
||||
// A<U>::A() {}
|
||||
//
|
||||
// A<int> a;
|
||||
//
|
||||
// }
|
||||
public void testBug377838() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// namespace N {
|
||||
// inline namespace M {
|
||||
// template<class T> void f(T&) { }
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
* Bryan Wilkinson (QNX)
|
||||
* Andrew Ferguson (Symbian)
|
||||
* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -136,6 +137,8 @@ abstract public class CPPScope implements ICPPASTInternalScope {
|
|||
return false;
|
||||
|
||||
IASTName segmentName = segments[i];
|
||||
if ((scopeName instanceof ICPPASTTemplateId) != (segmentName instanceof ICPPASTTemplateId))
|
||||
return false;
|
||||
if (!CharArrayUtils.equals(scopeName.getSimpleID(), segmentName.getSimpleID()))
|
||||
return false;
|
||||
scope= scope.getParent();
|
||||
|
|
Loading…
Add table
Reference in a new issue