From: Richard Smith Date: Tue, 18 Mar 2014 22:43:19 +0000 (+0000) Subject: Fix a typo in r204164 that made *all* keywords available in OpenCL mode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08c7b3dd964e8dd54ca8f8a4381bcadd17e019dd;p=clang Fix a typo in r204164 that made *all* keywords available in OpenCL mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204196 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 0993b2335e..3b8aeec5b8 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -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; diff --git a/test/Parser/opencl-keywords.cl b/test/Parser/opencl-keywords.cl new file mode 100644 index 0000000000..5bc7054937 --- /dev/null +++ b/test/Parser/opencl-keywords.cl @@ -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; +}