mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
Add code completions for C++0x expressions
llvm-svn: 142357
This commit is contained in:
@@ -1811,8 +1811,35 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC,
|
||||
Builder.AddPlaceholderChunk("expression");
|
||||
Results.AddResult(Result(Builder.TakeString()));
|
||||
}
|
||||
|
||||
|
||||
// FIXME: Rethrow?
|
||||
|
||||
if (SemaRef.getLangOptions().CPlusPlus0x) {
|
||||
// nullptr
|
||||
Builder.AddTypedTextChunk("nullptr");
|
||||
Results.AddResult(Result(Builder.TakeString()));
|
||||
|
||||
// alignof
|
||||
Builder.AddTypedTextChunk("alignof");
|
||||
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
|
||||
Builder.AddPlaceholderChunk("type");
|
||||
Builder.AddChunk(CodeCompletionString::CK_RightParen);
|
||||
Results.AddResult(Result(Builder.TakeString()));
|
||||
|
||||
// noexcept
|
||||
Builder.AddTypedTextChunk("noexcept");
|
||||
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
|
||||
Builder.AddPlaceholderChunk("expression");
|
||||
Builder.AddChunk(CodeCompletionString::CK_RightParen);
|
||||
Results.AddResult(Result(Builder.TakeString()));
|
||||
|
||||
// sizeof... expression
|
||||
Builder.AddTypedTextChunk("sizeof...");
|
||||
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
|
||||
Builder.AddPlaceholderChunk("parameter-pack");
|
||||
Builder.AddChunk(CodeCompletionString::CK_RightParen);
|
||||
Results.AddResult(Result(Builder.TakeString()));
|
||||
}
|
||||
}
|
||||
|
||||
if (SemaRef.getLangOptions().ObjC1) {
|
||||
|
||||
@@ -26,8 +26,11 @@ void g() {
|
||||
vector<int>(foo(), foo());
|
||||
}
|
||||
|
||||
// RUN: c-index-test -code-completion-at=%s:20:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:20:2 %s | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
// RUN: c-index-test -code-completion-at=%s:20:2 %s -std=c++0x | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:20:2 -std=c++0x %s | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
// CHECK-CC1: NotImplemented:{TypedText alignof}{LeftParen (}{Placeholder type}{RightParen )} (40)
|
||||
// CHECK-CC1: NotImplemented:{TypedText noexcept}{LeftParen (}{Placeholder expression}{RightParen )} (40)
|
||||
// CHECK-CC1: NotImplemented:{TypedText nullptr} (40)
|
||||
// CHECK-CC1: NotImplemented:{TypedText operator} (40)
|
||||
// CHECK-CC1-NOT: push_back
|
||||
// CHECK-CC1: ClassDecl:{TypedText string} (50)
|
||||
|
||||
Reference in New Issue
Block a user