lh123 updated this revision to Diff 273074. lh123 retitled this revision from "[CodeComplete] Tweak code completion for `typename` and `using`." to "[CodeComplete] Tweak code completion for `typename`.". lh123 added a comment.
Address comment. I will add `using $alias$ = $type$;` in a separate patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82373/new/ https://reviews.llvm.org/D82373 Files: clang/lib/Sema/SemaCodeComplete.cpp clang/test/CodeCompletion/ordinary-name-cxx11.cpp clang/test/CodeCompletion/ordinary-name.cpp
Index: clang/test/CodeCompletion/ordinary-name.cpp =================================================================== --- clang/test/CodeCompletion/ordinary-name.cpp +++ clang/test/CodeCompletion/ordinary-name.cpp @@ -54,7 +54,7 @@ // CHECK-CC1: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC1-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; // CHECK-CC1-NEXT: COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>) - // CHECK-CC1-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC1-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC1-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC1-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC1-NEXT: COMPLETION: union @@ -97,7 +97,7 @@ // CHECK-CC2-NEXT: COMPLETION: Pattern : template<<#parameters#>> // CHECK-CC2-NEXT: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC2-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; - // CHECK-CC2-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC2-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC2-NEXT: COMPLETION: union @@ -134,7 +134,7 @@ // CHECK-CC3-NEXT: COMPLETION: struct // CHECK-CC3-NEXT: COMPLETION: Pattern : template<<#parameters#>> // CHECK-CC3-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; - // CHECK-CC3-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC3-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC3-NEXT: COMPLETION: union @@ -176,7 +176,7 @@ // CHECK-CC4-NEXT: COMPLETION: Pattern : [#bool#]true // CHECK-CC4-NEXT: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC4-NEXT: COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>) - // CHECK-CC4-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC4-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC4-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC4-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC4-NEXT: COMPLETION: union @@ -227,7 +227,7 @@ // CHECK-NO-RTTI: COMPLETION: TYPEDEF : TYPEDEF // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; // CHECK-NO-RTTI-NOT: typeid - // CHECK-NO-RTTI: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-NO-RTTI: COMPLETION: Pattern : typename <#name#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-NO-RTTI-NEXT: COMPLETION: union Index: clang/test/CodeCompletion/ordinary-name-cxx11.cpp =================================================================== --- clang/test/CodeCompletion/ordinary-name-cxx11.cpp +++ clang/test/CodeCompletion/ordinary-name-cxx11.cpp @@ -57,7 +57,7 @@ // CHECK-CC1: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC1-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; // CHECK-CC1-NEXT: COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>) - // CHECK-CC1-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC1-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC1-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC1-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC1-NEXT: COMPLETION: union @@ -107,7 +107,7 @@ // CHECK-CC2-NEXT: COMPLETION: thread_local // CHECK-CC2-NEXT: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC2-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; - // CHECK-CC2-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC2-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC2-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC2-NEXT: COMPLETION: union @@ -150,7 +150,7 @@ // CHECK-CC3-NEXT: COMPLETION: Pattern : template<<#parameters#>> // CHECK-CC3-NEXT: COMPLETION: thread_local // CHECK-CC3-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; - // CHECK-CC3-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC3-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC3-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC3-NEXT: COMPLETION: union @@ -198,7 +198,7 @@ // CHECK-CC4-NEXT: COMPLETION: Pattern : [#bool#]true // CHECK-CC4-NEXT: COMPLETION: TYPEDEF : TYPEDEF // CHECK-CC4-NEXT: COMPLETION: Pattern : [#std::type_info#]typeid(<#expression-or-type#>) - // CHECK-CC4-NEXT: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-CC4-NEXT: COMPLETION: Pattern : typename <#name#> // CHECK-CC4-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-CC4-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-CC4-NEXT: COMPLETION: union @@ -259,7 +259,7 @@ // CHECK-NO-RTTI: COMPLETION: TYPEDEF : TYPEDEF // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typedef <#type#> <#name#>; // CHECK-NO-RTTI-NOT: typeid - // CHECK-NO-RTTI: COMPLETION: Pattern : typename <#qualifier#>::<#name#> + // CHECK-NO-RTTI: COMPLETION: Pattern : typename <#name#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof <#expression#> // CHECK-NO-RTTI-NEXT: COMPLETION: Pattern : typeof(<#type#>) // CHECK-NO-RTTI-NEXT: COMPLETION: union Index: clang/lib/Sema/SemaCodeComplete.cpp =================================================================== --- clang/lib/Sema/SemaCodeComplete.cpp +++ clang/lib/Sema/SemaCodeComplete.cpp @@ -1687,11 +1687,9 @@ Results.AddResult(Result("class", CCP_Type)); Results.AddResult(Result("wchar_t", CCP_Type)); - // typename qualified-id + // typename name Builder.AddTypedTextChunk("typename"); Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace); - Builder.AddPlaceholderChunk("qualifier"); - Builder.AddTextChunk("::"); Builder.AddPlaceholderChunk("name"); Results.AddResult(Result(Builder.TakeString()));
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits