Builder.AddPlaceholderChunk("name");
Builder.AddChunk(CodeCompletionString::CK_Equal);
Builder.AddPlaceholderChunk("namespace");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
// Using directives
Builder.AddTextChunk("namespace");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("identifier");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
// asm(string-literal)
Builder.AddPlaceholderChunk("qualifier");
Builder.AddTextChunk("::");
Builder.AddPlaceholderChunk("name");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
// using typename qualifier::name (only in a dependent context)
Builder.AddPlaceholderChunk("qualifier");
Builder.AddTextChunk("::");
Builder.AddPlaceholderChunk("name");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
}
if (S->getContinueParent()) {
// continue ;
Builder.AddTypedTextChunk("continue");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
}
if (S->getBreakParent()) {
// break ;
Builder.AddTypedTextChunk("break");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
}
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("expression");
}
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
// goto identifier ;
Builder.AddTypedTextChunk("goto");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("label");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
// Using directives
Builder.AddTextChunk("namespace");
Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
Builder.AddPlaceholderChunk("identifier");
+ Builder.AddChunk(CodeCompletionString::CK_SemiColon);
Results.AddResult(Result(Builder.TakeString()));
AddStaticAssertResult(Builder, Results, SemaRef.getLangOpts());
// CHECK-CC1-NEXT: COMPLETION: float
// CHECK-CC1-NEXT: COMPLETION: foo : [#void#]foo()
// CHECK-CC1-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){
- // CHECK-CC1: COMPLETION: Pattern : goto <#label#>
+ // CHECK-CC1: COMPLETION: Pattern : goto <#label#>;
// CHECK-CC1-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#>
// CHECK-CC1: COMPLETION: int
// CHECK-CC1-NEXT: COMPLETION: long
// CHECK-CC1-NEXT: COMPLETION: Pattern : [#std::nullptr_t#]nullptr
// CHECK-CC1-NEXT: COMPLETION: operator
// CHECK-CC1-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>)
- // CHECK-CC1-NEXT: COMPLETION: Pattern : return
+ // CHECK-CC1-NEXT: COMPLETION: Pattern : return;
// CHECK-CC1-NEXT: COMPLETION: short
// CHECK-CC1-NEXT: COMPLETION: signed
// CHECK-CC1-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>)
// CHECK-CC1-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC1-NEXT: COMPLETION: union
// CHECK-CC1-NEXT: COMPLETION: unsigned
- // CHECK-CC1-NEXT: COMPLETION: Pattern : using namespace <#identifier#>
+ // CHECK-CC1-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-CC1-NEXT: COMPLETION: void
// CHECK-CC1-NEXT: COMPLETION: volatile
// CHECK-CC1-NEXT: COMPLETION: wchar_t
// CHECK-CC2-NEXT: COMPLETION: int
// CHECK-CC2-NEXT: COMPLETION: long
// CHECK-CC2-NEXT: COMPLETION: Pattern : namespace <#identifier#>{<#declarations#>
- // CHECK-CC2: COMPLETION: Pattern : namespace <#name#> = <#namespace#>
+ // CHECK-CC2: COMPLETION: Pattern : namespace <#name#> = <#namespace#>;
// CHECK-CC2-NEXT: COMPLETION: operator
// CHECK-CC2-NEXT: COMPLETION: short
// CHECK-CC2-NEXT: COMPLETION: signed
// CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC2-NEXT: COMPLETION: union
// CHECK-CC2-NEXT: COMPLETION: unsigned
- // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>
- // CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>;
// CHECK-CC2-NEXT: COMPLETION: void
// CHECK-CC2-NEXT: COMPLETION: volatile
// CHECK-CC2-NEXT: COMPLETION: wchar_t
// CHECK-NO-RTTI-NEXT: COMPLETION: float
// CHECK-NO-RTTI-NEXT: COMPLETION: foo : [#void#]foo()
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){
- // CHECK-NO-RTTI: COMPLETION: Pattern : goto <#label#>
+ // CHECK-NO-RTTI: COMPLETION: Pattern : goto <#label#>;
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#>
// CHECK-NO-RTTI: COMPLETION: int
// CHECK-NO-RTTI-NEXT: COMPLETION: long
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : [#std::nullptr_t#]nullptr
// CHECK-NO-RTTI-NEXT: COMPLETION: operator
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>)
- // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : return
+ // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : return;
// CHECK-NO-RTTI-NEXT: COMPLETION: short
// CHECK-NO-RTTI-NEXT: COMPLETION: signed
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>)
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-NO-RTTI-NEXT: COMPLETION: union
// CHECK-NO-RTTI-NEXT: COMPLETION: unsigned
- // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : using namespace <#identifier#>
+ // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-NO-RTTI-NEXT: COMPLETION: void
// CHECK-NO-RTTI-NEXT: COMPLETION: volatile
// CHECK-NO-RTTI-NEXT: COMPLETION: wchar_t
// CHECK-CC1-NEXT: COMPLETION: float
// CHECK-CC1-NEXT: COMPLETION: foo : [#void#]foo()
// CHECK-CC1-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){
- // CHECK-CC1: COMPLETION: Pattern : goto <#label#>
+ // CHECK-CC1: COMPLETION: Pattern : goto <#label#>;
// CHECK-CC1-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#>
// CHECK-CC1: COMPLETION: int
// CHECK-CC1-NEXT: COMPLETION: long
// CHECK-CC1-NEXT: COMPLETION: Pattern : new <#type#>[<#size#>](<#expressions#>)
// CHECK-CC1-NEXT: COMPLETION: operator
// CHECK-CC1-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>)
- // CHECK-CC1-NEXT: COMPLETION: Pattern : return
+ // CHECK-CC1-NEXT: COMPLETION: Pattern : return;
// CHECK-CC1-NEXT: COMPLETION: short
// CHECK-CC1-NEXT: COMPLETION: signed
// CHECK-CC1-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>)
// CHECK-CC1-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC1-NEXT: COMPLETION: union
// CHECK-CC1-NEXT: COMPLETION: unsigned
- // CHECK-CC1-NEXT: COMPLETION: Pattern : using namespace <#identifier#>
+ // CHECK-CC1-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-CC1-NEXT: COMPLETION: void
// CHECK-CC1-NEXT: COMPLETION: volatile
// CHECK-CC1-NEXT: COMPLETION: wchar_t
// CHECK-CC2-NEXT: COMPLETION: int
// CHECK-CC2-NEXT: COMPLETION: long
// CHECK-CC2-NEXT: COMPLETION: Pattern : namespace <#identifier#>{<#declarations#>
- // CHECK-CC2: COMPLETION: Pattern : namespace <#name#> = <#namespace#>
+ // CHECK-CC2: COMPLETION: Pattern : namespace <#name#> = <#namespace#>;
// CHECK-CC2-NEXT: COMPLETION: operator
// CHECK-CC2-NEXT: COMPLETION: short
// CHECK-CC2-NEXT: COMPLETION: signed
// CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC2-NEXT: COMPLETION: union
// CHECK-CC2-NEXT: COMPLETION: unsigned
- // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>
- // CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>;
// CHECK-CC2-NEXT: COMPLETION: void
// CHECK-CC2-NEXT: COMPLETION: volatile
// CHECK-CC2-NEXT: COMPLETION: wchar_t
// CHECK-CC3-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-CC3-NEXT: COMPLETION: union
// CHECK-CC3-NEXT: COMPLETION: unsigned
- // CHECK-CC3-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>
+ // CHECK-CC3-NEXT: COMPLETION: Pattern : using <#qualifier#>::<#name#>;
// CHECK-CC3-NEXT: COMPLETION: virtual
// CHECK-CC3-NEXT: COMPLETION: void
// CHECK-CC3-NEXT: COMPLETION: volatile
// CHECK-NO-RTTI-NEXT: COMPLETION: float
// CHECK-NO-RTTI-NEXT: COMPLETION: foo : [#void#]foo()
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : for(<#init-statement#>;<#condition#>;<#inc-expression#>){
- // CHECK-NO-RTTI: COMPLETION: Pattern : goto <#label#>
+ // CHECK-NO-RTTI: COMPLETION: Pattern : goto <#label#>;
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : if(<#condition#>){<#statements#>
// CHECK-NO-RTTI: COMPLETION: int
// CHECK-NO-RTTI-NEXT: COMPLETION: long
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : new <#type#>[<#size#>](<#expressions#>)
// CHECK-NO-RTTI-NEXT: COMPLETION: operator
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : reinterpret_cast<<#type#>>(<#expression#>)
- // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : return
+ // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : return;
// CHECK-NO-RTTI-NEXT: COMPLETION: short
// CHECK-NO-RTTI-NEXT: COMPLETION: signed
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : [#size_t#]sizeof(<#expression-or-type#>)
// CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof(<#type#>)
// CHECK-NO-RTTI-NEXT: COMPLETION: union
// CHECK-NO-RTTI-NEXT: COMPLETION: unsigned
- // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : using namespace <#identifier#>
+ // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : using namespace <#identifier#>;
// CHECK-NO-RTTI-NEXT: COMPLETION: void
// CHECK-NO-RTTI-NEXT: COMPLETION: volatile
// CHECK-NO-RTTI-NEXT: COMPLETION: wchar_t
--- /dev/null
+void loops() {
+ while (true) {
+ // line 3
+ }
+ for (;;) {
+ // line 6
+ }
+ do {
+ // line 9
+ } while (true);
+ // line 11
+}
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:3:1 %s -o - | FileCheck -check-prefix=LOOP %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:6:1 %s -o - | FileCheck -check-prefix=LOOP %s
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:9:1 %s -o - | FileCheck -check-prefix=LOOP %s
+// LOOP: COMPLETION: Pattern : break;{{$}}
+// LOOP: COMPLETION: Pattern : continue;{{$}}
+// LOOP: COMPLETION: Pattern : goto <#label#>;{{$}}
+// LOOP: COMPLETION: Pattern : return;{{$}}
+//
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:11:1 %s -o - | FileCheck -check-prefix=OUTSIDE-LOOP %s
+// OUTSIDE-LOOP-NOT: COMPLETION: Pattern : break;{{$}}
+// OUTSIDE-LOOP-NOT: COMPLETION: Pattern : continue;{{$}}
+// OUTSIDE-LOOP: COMPLETION: Pattern : goto <#label#>;{{$}}
+// OUTSIDE-LOOP: COMPLETION: Pattern : return;{{$}}
+
+int value_return() {
+ // line 28
+}
+void void_return() {
+ // line 31
+}
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:28:1 %s -o - | FileCheck -check-prefix=RETURN-VAL %s
+// RETURN-VAL-NOT: COMPLETION: Pattern : return;{{$}}
+// RETURN-VAL: COMPLETION: Pattern : return <#expression#>;{{$}}
+
+// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:31:1 %s -o - | FileCheck -check-prefix=RETURN-VOID %s
+// RETURN-VOID-NOT: COMPLETION: Pattern : return <#expression#>;{{$}}
+// RETURN-VOID: COMPLETION: Pattern : return;{{$}}