forked from qt-creator/qt-creator
		
	C++: nested class in function
Case when nested class declaration contains object name for this class.
Example:
void fun()
{
    struct S
    {
        int i;
    } s;
    s.i;
}
Fixes:
* highlighting
* completion
* tests
Task-number: QTCREATORBUG-11710
Change-Id: I32e234f57655c388a87a199edc8be750d7bf823f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Nikolai Kosjar
					
				
			
			
				
	
			
			
			
						parent
						
							46c083c2eb
						
					
				
				
					commit
					e3f5977311
				
			@@ -866,8 +866,12 @@ ClassOrNamespace *ResolveExpression::findClass(const FullySpecifiedType &origina
 | 
			
		||||
    FullySpecifiedType ty = originalTy.simplified();
 | 
			
		||||
    ClassOrNamespace *binding = 0;
 | 
			
		||||
 | 
			
		||||
    if (Class *klass = ty->asClassType())
 | 
			
		||||
        binding = _context.lookupType(klass, enclosingTemplateInstantiation);
 | 
			
		||||
    if (Class *klass = ty->asClassType()) {
 | 
			
		||||
        if (scope->isBlock())
 | 
			
		||||
            binding = _context.lookupType(klass->name(), scope, enclosingTemplateInstantiation);
 | 
			
		||||
        if (!binding)
 | 
			
		||||
            binding = _context.lookupType(klass, enclosingTemplateInstantiation);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    else if (NamedType *namedTy = ty->asNamedType())
 | 
			
		||||
        binding = _context.lookupType(namedTy->name(), scope, enclosingTemplateInstantiation);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user