diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-08-19 01:28:28 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-08-19 01:28:28 +0000 |
commit | e8661906d49ef6c9694a9cc845ca62a85dbc016d (patch) | |
tree | 4e57e7e6580846b549c332461ea44ad5c3f322e6 /lib/Sema/SemaExprCXX.cpp | |
parent | 1bb8a45f7386a23871598d05141a07af03067925 (diff) |
Use Sema's LocInfoType to pass and preserve type source info through the Parser.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 2705d9900b..7c3f7ecaab 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -31,7 +31,8 @@ Sema::ActOnCXXConversionFunctionExpr(Scope *S, SourceLocation OperatorLoc, TypeTy *Ty, bool HasTrailingLParen, const CXXScopeSpec &SS, bool isAddressOfOperand) { - QualType ConvType = QualType::getFromOpaquePtr(Ty); + //FIXME: Preserve type source info. + QualType ConvType = GetTypeFromParser(Ty); CanQualType ConvTypeCanon = Context.getCanonicalType(ConvType); DeclarationName ConvName = Context.DeclarationNames.getCXXConversionFunctionName(ConvTypeCanon); @@ -62,7 +63,11 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc, NamespaceDecl *StdNs = GetStdNamespace(); if (!StdNs) return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid)); - + + if (isType) + // FIXME: Preserve type source info. + TyOrExpr = GetTypeFromParser(TyOrExpr).getAsOpaquePtr(); + IdentifierInfo *TypeInfoII = &PP.getIdentifierTable().get("type_info"); Decl *TypeInfoDecl = LookupQualifiedName(StdNs, TypeInfoII, LookupTagName); RecordDecl *TypeInfoRecordDecl = dyn_cast_or_null<RecordDecl>(TypeInfoDecl); @@ -179,7 +184,8 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep, SourceLocation *CommaLocs, SourceLocation RParenLoc) { assert(TypeRep && "Missing type!"); - QualType Ty = QualType::getFromOpaquePtr(TypeRep); + // FIXME: Preserve type source info. + QualType Ty = GetTypeFromParser(TypeRep); unsigned NumExprs = exprs.size(); Expr **Exprs = (Expr**)exprs.get(); SourceLocation TyBeginLoc = TypeRange.getBegin(); @@ -1051,7 +1057,7 @@ Sema::OwningExprResult Sema::ActOnUnaryTypeTrait(UnaryTypeTrait OTT, SourceLocation LParen, TypeTy *Ty, SourceLocation RParen) { - QualType T = QualType::getFromOpaquePtr(Ty); + QualType T = GetTypeFromParser(Ty); // According to http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html // all traits except __is_class, __is_enum and __is_union require a the type |