Go to file
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
clang Fix heuristics skipping invalid ctor-initializers with C++11 2016-11-03 07:36:17 +00:00
clang-tools-extra [clang-tidy] Suppress notes for warnings that were ignored 2016-11-02 21:14:22 +00:00
compiler-rt [asan] Add more dynamic CRT mode tests 2016-11-02 15:39:08 +00:00
debuginfo-tests
libclc Provide vstore_half helper to workaround clc restrictions 2016-09-21 20:15:55 +00:00
libcxx Implement another part of P0031; adding constexpr to move_iterator 2016-11-02 15:30:26 +00:00
libcxxabi [p0012] Implement ABI support for throwing a noexcept function pointer and 2016-11-02 23:41:51 +00:00
libunwind Add support for old versions of MacOS to libunwind. Fixes PR22203. Thanks to Jeremy for the bug report and the patch. 2016-11-02 17:56:05 +00:00
lld Pass the sections to getShtGroupSignature. 2016-11-03 02:28:13 +00:00
lldb [cmake] Build gtest from LLVM when building standalone 2016-11-02 22:57:23 +00:00
llgo
llvm [CMake] Disable rpath for UnitTests 2016-11-03 06:58:16 +00:00
openmp Change task stealing to always get task from head of victim's deque. 2016-11-02 16:45:25 +00:00
parallel-libs [Acxxel] Remove setActiveDeviceForThread 2016-10-28 00:54:02 +00:00
polly [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00