OpenCL requires string literals to be in the constant address space.
Details
Diff Detail
Event Timeline
Does LangOpts.OpenCL imply LangOpts.ConstStrings? It probably should, just in case anything else is checking to see if it can rely on all string constants being const. You could even then (in a followup patch) complain if anyone tried to turn this off, e.g. with -fwritable-strings.
(I see that you still have to special case the address space.)
I made LangOpts.OpenCL imply LangOpts.ConstStrings, and updated some of the tests I missed the first time round.
I updated this patch to remove the 'const' part as I now believe it is wrong, and I changed IsModifiable as Tanya suggested.
Ok to commit?
Sorry about the long delay on this.
This is supposed to use the string constant sharing mechanism, right? Maybe a test could be added that checks that the constant data is shared for two same string constants? Otherwise, LGTM.