From 603d81bf8d055732b3ba24899dd9c443e1ef243b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 13 Jul 2010 08:18:22 +0000 Subject: When forming a function call or message send expression, be sure to strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234 --- clang/lib/Sema/SemaCodeComplete.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaCodeComplete.cpp') diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 6a706dfefe5..82861101e83 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -567,11 +567,11 @@ static QualType getDeclUsageType(ASTContext &C, NamedDecl *ND) { QualType T; if (FunctionDecl *Function = dyn_cast(ND)) - T = Function->getResultType(); + T = Function->getCallResultType(); else if (ObjCMethodDecl *Method = dyn_cast(ND)) - T = Method->getResultType(); + T = Method->getSendResultType(); else if (FunctionTemplateDecl *FunTmpl = dyn_cast(ND)) - T = FunTmpl->getTemplatedDecl()->getResultType(); + T = FunTmpl->getTemplatedDecl()->getCallResultType(); else if (EnumConstantDecl *Enumerator = dyn_cast(ND)) T = C.getTypeDeclType(cast(Enumerator->getDeclContext())); else if (ObjCPropertyDecl *Property = dyn_cast(ND)) -- cgit v1.2.3