File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,7 @@ bool ExpandAutoType::prepare(const Selection& Inputs) {
96
96
if (auto *Node = Inputs.ASTSelection .commonAncestor ()) {
97
97
if (auto *TypeNode = Node->ASTNode .get <TypeLoc>()) {
98
98
if (const AutoTypeLoc Result = TypeNode->getAs <AutoTypeLoc>()) {
99
- // Code in apply() does handle 'decltype(auto)' yet.
100
- if (!Result.getTypePtr ()->isDecltypeAuto () &&
101
- !isStructuredBindingType (Node) &&
99
+ if (!isStructuredBindingType (Node) &&
102
100
!isDeducedAsLambda (Node, Result.getBeginLoc ()) &&
103
101
!isTemplateParam (Node))
104
102
CachedLocation = Result;
Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ TEST_F(ExpandAutoTypeTest, Test) {
71
71
apply (" void ns::Func() { au^to x = new ns::Class::Nested{}; }" ),
72
72
" void ns::Func() { ns::Class::Nested * x = new ns::Class::Nested{}; }" );
73
73
74
- EXPECT_UNAVAILABLE (" dec^ltype(au^to) x = 10;" );
74
+ EXPECT_EQ (apply (" dec^ltype(auto) x = 10;" ), " int x = 10;" );
75
+ EXPECT_EQ (apply (" decltype(au^to) x = 10;" ), " int x = 10;" );
75
76
// expanding types in structured bindings is syntactically invalid.
76
77
EXPECT_UNAVAILABLE (" const ^auto &[x,y] = (int[]){1,2};" );
77
78
You can’t perform that action at this time.
0 commit comments