r204196 - Fix a typo in r204164 that made *all* keywords available in OpenCL mode.
Richard Smith
richard-llvm at metafoo.co.uk
Tue Mar 18 15:43:20 PDT 2014
Author: rsmith
Date: Tue Mar 18 17:43:19 2014
New Revision: 204196
URL: http://llvm.org/viewvc/llvm-project?rev=204196&view=rev
Log:
Fix a typo in r204164 that made *all* keywords available in OpenCL mode.
Added:
cfe/trunk/test/Parser/opencl-keywords.cl
Modified:
cfe/trunk/lib/Basic/IdentifierTable.cpp
Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=204196&r1=204195&r2=204196&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/lib/Basic/IdentifierTable.cpp Tue Mar 18 17:43:19 2014
@@ -130,7 +130,7 @@ static void AddKeyword(StringRef Keyword
else if (LangOpts.MicrosoftExt && (Flags & KEYMS)) AddResult = 1;
else if (LangOpts.Borland && (Flags & KEYBORLAND)) AddResult = 1;
else if (LangOpts.Bool && (Flags & BOOLSUPPORT)) AddResult = 2;
- else if (LangOpts.Half && (Flags && HALFSUPPORT)) AddResult = 2;
+ else if (LangOpts.Half && (Flags & HALFSUPPORT)) AddResult = 2;
else if (LangOpts.WChar && (Flags & WCHARSUPPORT)) AddResult = 2;
else if (LangOpts.AltiVec && (Flags & KEYALTIVEC)) AddResult = 2;
else if (LangOpts.OpenCL && (Flags & KEYOPENCL)) AddResult = 2;
Added: cfe/trunk/test/Parser/opencl-keywords.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/opencl-keywords.cl?rev=204196&view=auto
==============================================================================
--- cfe/trunk/test/Parser/opencl-keywords.cl (added)
+++ cfe/trunk/test/Parser/opencl-keywords.cl Tue Mar 18 17:43:19 2014
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
+
+void f(half *h) {
+ bool b;
+ int wchar_t;
+ int constexpr;
+}
More information about the cfe-commits
mailing list