Try to fix the type rewriter.

This commit is contained in:
Roberto Raggi
2010-07-19 20:12:16 +02:00
parent 55936532c2
commit 33b19f0210
4 changed files with 122 additions and 61 deletions

View File

@@ -37,6 +37,7 @@
#include <cplusplus/Overview.h>
#include <cplusplus/TypeOfExpression.h>
#include <cplusplus/DependencyTable.h>
#include <cplusplus/CppRewriter.h>
#include <TranslationUnit.h>
#include <ASTVisitor.h>
@@ -1532,8 +1533,18 @@ public:
TypeOfExpression::Preprocess);
if (! result.isEmpty()) {
SubstitutionEnvironment env;
env.setContext(context());
env.switchScope(result.first().scope());
UseQualifiedNames q;
env.enter(&q);
Control *control = context().control().data();
FullySpecifiedType tn = rewriteType(result.first().type(), &env, control);
Overview oo;
QString ty = oo(result.first().type());
QString ty = oo(tn);
if (! ty.isEmpty()) {
const QChar ch = ty.at(ty.size() - 1);