[PATCH] D52301: [clang] Set TypeSourceInfo for vardecl's in addition to type when we can deduce.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 12 05:52:05 PDT 2018


aaron.ballman added a reviewer: rsmith.
aaron.ballman added a comment.

Can you give a bit more background on what problem you're trying to solve with this patch?



================
Comment at: lib/Sema/SemaChecking.cpp:852
 
-  if (RT->getPointeeType().getAddressSpace() != LangAS::opencl_generic) {
-    S.Diag(Call->getArg(0)->getBeginLoc(),
----------------
I'm not certain I understand why this code has been removed?


================
Comment at: lib/Sema/SemaDecl.cpp:10766
 
-QualType Sema::deduceVarTypeFromInitializer(VarDecl *VDecl,
+std::pair<QualType, TypeSourceInfo*> Sema::deduceVarTypeFromInitializer(VarDecl *VDecl,
                                             DeclarationName Name, QualType Type,
----------------
Why does this need to return a pair? It seems like the returned `TypeSourceInfo*` carries all the information needed by the caller, or is there ever a case where the `QualType` will be different than what is returned by `TypeSourceInfo::getType()`?


Repository:
  rC Clang

https://reviews.llvm.org/D52301





More information about the cfe-commits mailing list