summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2015-06-05 01:10:24 +0000
committerHubert Tong <hubert.reinterpretcast@gmail.com>2015-06-05 01:10:24 +0000
commit6e04f98bc3eea437c3bdf738e3e247dd04181f5d (patch)
tree03d2b487254e2bfbeb9b0a1be3a51a90c6368613 /clang/lib/Basic/IdentifierTable.cpp
parent0c5a9c147681445861c8589685ee57d4aeb0a6e3 (diff)
downloadbcm5719-llvm-6e04f98bc3eea437c3bdf738e3e247dd04181f5d.tar.gz
bcm5719-llvm-6e04f98bc3eea437c3bdf738e3e247dd04181f5d.zip
[Concepts] lex keywords: concept and requires
Summary: This patch enables lexing of `concept` and `requires` as keywords. Further changes which add messages for future keyword compat are to follow. Test Plan: Testing of C++14 + Concepts TS mode is added to `test/Lexer/keywords_test.cpp`, which expects that the new keywords are enabled under said mode. Reviewers: faisalv, fraggamuffin, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10233 llvm-svn: 239128
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index e830be9603e..4e06352d31d 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -109,7 +109,8 @@ namespace {
KEYNOOPENCL = 0x02000,
WCHARSUPPORT = 0x04000,
HALFSUPPORT = 0x08000,
- KEYALL = (0xffff & ~KEYNOMS18 &
+ KEYCONCEPTS = 0x10000,
+ KEYALL = (0x1ffff & ~KEYNOMS18 &
~KEYNOOPENCL) // KEYNOMS18 and KEYNOOPENCL are used to exclude.
};
@@ -143,6 +144,7 @@ static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
// We treat bridge casts as objective-C keywords so we can warn on them
// in non-arc mode.
if (LangOpts.ObjC2 && (Flags & KEYARC)) return KS_Enabled;
+ if (LangOpts.ConceptsTS && (Flags & KEYCONCEPTS)) return KS_Enabled;
if (LangOpts.CPlusPlus && (Flags & KEYCXX11)) return KS_Future;
return KS_Disabled;
}
OpenPOWER on IntegriCloud