[PATCH] D65744: [PR42707][OpenCL] Fix addr space deduction for auto

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 04:51:38 PDT 2019


Anastasia added a comment.

In D65744#1626563 <https://reviews.llvm.org/D65744#1626563>, @rjmccall wrote:

> Isn't the general rule for template argument deduction (which this devolves to) just to ignore top-level qualifiers?  And then you can substitute in the substituted type and end up with a properly qualified type for the parameter / variable, and you can add extra qualifiers as necessary.  Why are special rules for pointers and references required?


The issue I am trying to solve is that the addr space qualifier for the pointee type in pointers and references is supposed to default to generic if none were provided either in the parameter or argument of template/auto type. But for all regular types the deduction happens early during parsing.  So I need to prevent the early deduction  and make sure the deduction happens once the type is being known (i.e. deduced).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65744/new/

https://reviews.llvm.org/D65744





More information about the cfe-commits mailing list