Overloadable function candidate should not be viable if it uses extensions (Half or Double type) that are not enabled or supported.
Patch by Egor Churaev
I would imagine if extension isn't supported the candidate function with data type defined by extension shouldn't be available at all during compilation?
Also is there any good way to generalize this for all types and extensions including vendor ones that are added with the pragmas?
I think it will be clearer if candidates with non-half parameters moved out of extension enabled block.
Wondering if better message could be:
candidate unavailable as it requires OpenCL extension to be disabled
Could it also print the extension name?
Yes, you are right.
There might be a way but I can't properly answer this question right now. By default types and extensions aren't associated to each other.
Sounds good. And I'd prefer to split it into another patch, because it would affect unrelated to the change tests and also require changes in Sema to allow extension name printing.