llvm-project/clang/test/CodeCompletion/incomplete-member.cpp
Kadir Cetinkaya 0731132888
[clang][CodeComplete] Dont perform fallback completion for incomplete member ref
Summary:
Clang performs expression based completion whenever it can't figure out
base of a member reference expression. It might be quite confusing in cases like
incomplete types. This patch disables that fallback.

Unfortunately `ParsePostfixExpressionSuffix` is quite tangled and this patch
adds more to it.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77570
2020-04-06 20:08:24 +02:00

9 lines
194 B
C++

struct IncompleteType;
void foo() {
IncompleteType *f;
f->x;
}
// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:5:6 %s -o - | FileCheck %s -allow-empty
// CHECK-NOT: COMPLETION: