[PATCH] D16351: [FIX] Bug 25404 - Crash on typedef in OpenCL 2.0

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 4 07:36:17 PST 2016


Anastasia added inline comments.

================
Comment at: test/SemaOpenCL/implicit-typedef.cl:3
@@ +2,3 @@
+// RUN: %clang_cc1 %s -cl-std=CL2.0 -fsyntax-only
+
+#if defined(TEST_WARNINGS)
----------------
ichesnokov wrote:
> Are you mean another text of warning? Notice that actual patch will work not only in OpenCL, but any language. If builtin functions present, it will prevent the crash. The single message "redefinition of typedef 'atomic_flag' is a C11 feature" is default for all targets.
> Do you want to have specific warning text for OpenCL?
No, you can use select{OpenCL|C11} or you can pass 'OpenCL' or 'C11' as a string to the diagnostic as an argument.

You can take a look at err_opencl_unknown_type_specifier as an example, that uses both approaches.

LangOpts.OpenCL will help you to detect the language mode for selecting/passing the right string.



http://reviews.llvm.org/D16351





More information about the cfe-commits mailing list