]> granicus.if.org Git - clang/commit
Changes to the name lookup have caused a regression in the digraph fix-it hint.
authorRichard Trieu <rtrieu@google.com>
Mon, 19 Sep 2011 19:01:00 +0000 (19:01 +0000)
committerRichard Trieu <rtrieu@google.com>
Mon, 19 Sep 2011 19:01:00 +0000 (19:01 +0000)
commit950be71c745409e373ae8a834490f9026c8ac222
tree95ce520a30c48013c7b777567c2022120e48e1d0
parent8c6f9c49e6b1af5917f5879aed5496d0886b4e90
Changes to the name lookup have caused a regression in the digraph fix-it hint.
For instance:

template <class T> void E() {};
class F {};

void test() {
 ::E<::F>();
 E<::F>();
}

Gives the following error messages:

error: found '<::' after a template name which forms the
     digraph '<:' (aka '[') and a ':', did you mean '< ::'?
 ::E<::F>();
    ^~~
    < ::
error: expected expression
 E<::F>();
    ^
error: expected ']'
note: to match this '['
 E<::F>();

This patch adds the digraph fix-it check right before the name lookup,
moves the shared checking code to a new function, and adds new
tests to catch future regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140039 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Parse/Parser.h
lib/Parse/ParseExprCXX.cpp
lib/Parse/ParseStmt.cpp
test/Parser/cxx-casting.cpp