-Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58120 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 9b1543f..6fd1c5c 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -402,7 +402,9 @@
if (FD->isInvalidDecl())
return true;
- return new DeclRefExpr(FD, FD->getType(), Loc);
+ // FIXME: Handle 'mutable'.
+ return new DeclRefExpr(FD,
+ FD->getType().getWithAdditionalQualifiers(MD->getTypeQualifiers()),Loc);
}
return Diag(Loc, diag::err_invalid_non_static_member_use, FD->getName());