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". llvm-svn: 134263
This commit is contained in:
parent
c063ac20d8
commit
3b22a88488
|
@ -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");
|
||||
|
|
|
@ -80,3 +80,9 @@ namespace nonstd {
|
|||
}
|
||||
|
||||
yarn str4; // expected-error{{unknown type name 'yarn'; did you mean 'nonstd::yarn'?}}
|
||||
|
||||
namespace check_bool {
|
||||
void f() {
|
||||
Bool b; // expected-error{{use of undeclared identifier 'Bool'; did you mean 'bool'?}}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue