aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-01 21:27:45 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-01 21:27:45 +0000
commit07f4a06c402a2ccdd9eae7a3d710990b22040001 (patch)
treebe9466e4646077ff6ea71aaa3c613393031099e2 /lib/Sema/SemaLookup.cpp
parentdf9a41f3c1d1ca5aec6e2c17e38c29cff72b8726 (diff)
When adding boolean keywords for typo correction, add either "bool" or
"_Bool" (depending on dialect), but not both, since they have the same edit distance from "Bool". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index a2e5c7c98f..951fbfac7a 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -3417,7 +3417,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef,
// Add type-specifier keywords to the set of results.
const char *CTypeSpecs[] = {
"char", "const", "double", "enum", "float", "int", "long", "short",
- "signed", "struct", "union", "unsigned", "void", "volatile", "_Bool",
+ "signed", "struct", "union", "unsigned", "void", "volatile",
"_Complex", "_Imaginary",
// storage-specifiers as well
"extern", "inline", "static", "typedef"
@@ -3431,7 +3431,9 @@ static void AddKeywordsToConsumer(Sema &SemaRef,
Consumer.addKeywordResult("restrict");
if (SemaRef.getLangOptions().Bool || SemaRef.getLangOptions().CPlusPlus)
Consumer.addKeywordResult("bool");
-
+ else if (SemaRef.getLangOptions().C99)
+ Consumer.addKeywordResult("_Bool");
+
if (SemaRef.getLangOptions().CPlusPlus) {
Consumer.addKeywordResult("class");
Consumer.addKeywordResult("typename");