llvm-project/clang/test/CodeCompletion
Olivier Goffart 3cd1013739 Fix heuristics skipping invalid ctor-initializers with C++11
Use better heuristics to detect if a '{' might be the start of the constructor body
or not. Especially when there is a completion token.

Fix the test 'test/CodeCompletion/ctor-initializer.cpp ' when clang defaults to c++11

The problem was is how we recover invalid code in the ctor-init part as we skip the
function body. In particular, we want to know if a '{' is the begining of the body.
In C++03, we always consider it as the beginng of the body. The problem was that in
C++11, it may be the start of an initializer, so we skip over it, causing further
parse errors later. (It is important that we are able to parse correctly the rest
of the class definition, to know what are the class member, for example)

This commit is improving the heuristics to decide if the '{' is starting a function
body. The rules are the following: If we are not in a template argument, and that the
previous tokens are not an identifier, or a >, then it is much more likely to be the
function body. We verify that further by checking the token after the matching '}'

The commit also fix the behavior when there is a code_completion token in the
ctor-initializers.

Differential Revision: https://reviews.llvm.org/D21502

llvm-svn: 285883
2016-11-03 07:36:17 +00:00
..
Inputs [CodeCompletion] Allow system headers providing private symbols with a single underscore. 2016-07-01 01:17:02 +00:00
PR9728.cpp
auto.cpp
bracket-decl.c [Parse] Code complete expressions in bracket declarators. 2016-02-18 15:30:24 +00:00
call.c
call.cpp
constexpr.cpp
ctor-initializer.cpp Fix heuristics skipping invalid ctor-initializers with C++11 2016-11-03 07:36:17 +00:00
documentation.cpp
documentation.m Fix ObjCMethodDecl::findPropertyDecl for class properties. 2016-03-11 21:14:40 +00:00
enum-switch-case-qualified.cpp
enum-switch-case.c
enum-switch-case.cpp
function-templates.cpp
functions.cpp
macros-in-modules.c
macros-in-modules.m
macros.c
member-access.c
member-access.cpp
namespace-alias.cpp
namespace.cpp
nested-name-specifier.cpp
objc-expr.m
objc-message.m
objc-message.mm Implement filtering for code completion of identifiers. 2016-07-27 14:56:59 +00:00
objc-protocol-member-access.m [CodeCompletion] Show protocol properties that are accessed through qualified id 2016-10-12 11:40:15 +00:00
operator.cpp
ordinary-name-cxx11.cpp [Tests] Modified Lit Tests to be C++11 compatibile 2015-08-27 18:49:15 +00:00
ordinary-name.c [CodeCompletion] Allow system headers providing private symbols with a single underscore. 2016-07-01 01:17:02 +00:00
ordinary-name.cpp [Tests] Modified Lit Tests to be C++11 compatibile 2015-08-27 18:49:15 +00:00
pch-and-module.m Fix CodeCompletion & TypoCorrection when combining a PCH with Modules 2016-05-04 00:53:13 +00:00
preamble.c
some_struct.h
stdin.c
tag.c
tag.cpp
templates.cpp
truncation.c
truncation.c.h
using-namespace.cpp
using.cpp