Commit f335855a authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Warn about unexpected using declarations.

parent 405353ab
...@@ -482,11 +482,15 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name, ...@@ -482,11 +482,15 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name,
return e; return e;
else if (_templateId) { else if (_templateId) {
Q_ASSERT(_usings.size() == 1); if (_usings.size() == 1) {
ClassOrNamespace *delegate = _usings.first(); ClassOrNamespace *delegate = _usings.first();
if (ClassOrNamespace *r = delegate->lookupType_helper(name, processed, /*searchInEnclosingScope = */ true)) if (ClassOrNamespace *r = delegate->lookupType_helper(name, processed, /*searchInEnclosingScope = */ true))
return r; return r;
} else {
if (debug)
qWarning() << "expected one using declaration. Number of using declarations is:" << _usings.size();
}
} }
foreach (ClassOrNamespace *u, usings()) { foreach (ClassOrNamespace *u, usings()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment