summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index dfc1cce89d..f0c11bb233 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -764,6 +764,13 @@ static void InsertOCLBuiltinDeclarationsFromTable(Sema &S, LookupResult &LR,
BuiltinTable[FctIndex + SignatureIndex];
ASTContext &Context = S.Context;
+ // Ignore this BIF if its version does not match the language options.
+ if (Context.getLangOpts().OpenCLVersion < OpenCLBuiltin.MinVersion)
+ continue;
+ if ((OpenCLBuiltin.MaxVersion != 0) &&
+ (Context.getLangOpts().OpenCLVersion >= OpenCLBuiltin.MaxVersion))
+ continue;
+
SmallVector<QualType, 1> RetTypes;
SmallVector<SmallVector<QualType, 1>, 5> ArgTypes;