mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 14:16:06 +00:00

Added string literal helper function to obtain the type attributed by a constant address space. Also fixed predefind __func__ expr to use the helper to constract the string literal correctly. Differential Revision: https://reviews.llvm.org/D46049 llvm-svn: 331877
9 lines
470 B
Common Lisp
9 lines
470 B
Common Lisp
// RUN: %clang_cc1 %s -verify
|
|
// RUN: %clang_cc1 %s -verify -cl-std=CL2.0
|
|
|
|
void f() {
|
|
char *f1 = __func__; //expected-error-re{{initializing '{{__generic char|char}} *' with an expression of type 'const __constant char *' changes address space of pointer}}
|
|
constant char *f2 = __func__; //expected-warning{{initializing '__constant char *' with an expression of type 'const __constant char [2]' discards qualifiers}}
|
|
constant const char *f3 = __func__;
|
|
}
|