| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
apologies.
llvm-svn: 311975
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is made.
Prior to this patch, clang would do the wrong thing here (see inline comments for pre-patch behavior):
struct A {
void bar(int) { }
static void bar(double) { }
void g(int*);
static void g(char *);
};
struct B {
void f() {
A::bar(3); // selects (double) ??!!
A::g((int*)0); // Instead of no object argument, states conversion error?!!
}
};
The fix is as follows: When we detect that what appears to be an implicit member function call (A::bar) is actually a call to a member of a class (A) unrelated to the type (B) that contains the member function (B::f) from which the call is being made, don't treat it (A::bar) as an Implicit Member Call Expression.
P.S. I wonder if there is an existing bug report related to this? (Surprisingly, a cursory search did not find one).
llvm-svn: 311839
|
|
|
|
|
|
|
| |
Expected diagnostics have been expanded to vary by C++ dialect.
RUN line has also been expanded to: default, C++98/03 and C++11.
llvm-svn: 252785
|
|
|
|
| |
llvm-svn: 233981
|
|
|
|
|
|
|
|
|
|
| |
This patch was submitted to the list for review and didn't receive a LGTM.
(In fact one explicit objection and one query were raised.)
This reverts commit r197295.
llvm-svn: 197299
|
|
|
|
|
|
| |
Differential Revision: http://llvm-reviews.chandlerc.com/D2392
llvm-svn: 197295
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a line like
// expected-error-re {{foo}}
treats the entirety of foo as a regex. This is inconvenient when matching type
names containing regex characters. For example, to match
"void *(class test8::A::*)(void)" inside such a regex, one would have to type
"void \*\(class test8::A::\*\)\(void\)".
This patch changes the semantics of expected-error-re to only treat the parts
of the directive wrapped in double curly braces as regexes. This avoids the
escaping problem and leads to nicer patterns for those cases; see e.g. the
change to test/Sema/format-strings-scanf.c.
(The balanced search for closing }} of a directive also makes us handle the
full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.)
Differential Revision: http://llvm-reviews.chandlerc.com/D2388
llvm-svn: 197092
|
|
|
|
|
|
|
| |
Revert this patch until cases of rejected valid code (e.g. identifiers
that require ADL to be resolved properly) are fixed.
llvm-svn: 194088
|
|
|
|
|
|
|
|
|
|
|
|
| |
Similar C code isn't caught as it seems to hit a different code path.
Also, as the check is only done for record pointers, cases involving
an overloaded operator-> are not handled either. Note that the reason
this check is done in the parser instead of Sema is not related to
having enough knowledge about the current state as it is about being
able to fix up the parser's state to be able to recover and traverse the
correct code paths.
llvm-svn: 194002
|
|
|
|
|
|
| |
recovering by adding empty parenthesis. Fixes PR16676!
llvm-svn: 188920
|
|
|
|
| |
llvm-svn: 187521
|
|
|
|
|
|
| |
changing '->' to '.' when there is no operator-> defined for a class.
llvm-svn: 187504
|
|
|
|
| |
llvm-svn: 186348
|
|
|
|
|
|
|
|
| |
recovery is not attempted with the fixit. Also move the associated test
case from FixIt/fixit.cpp to SemaCXX/member-expr.cpp since the fixit is
no longer automatically applied.
llvm-svn: 186342
|
|
|
|
|
|
|
|
|
|
| |
type-name is looked up in the context of the complete postfix-expression. Don't
forget to pass the scope into this lookup when the type-name is a template-id;
it might name an alias template which can't be found within the class itself.
Bug spotted by Johannes Schaub on #llvm.
llvm-svn: 168011
|
|
|
|
|
|
|
|
|
|
|
| |
Set the source location for the "member reference base type ... is not a
structure or union" diag to point at the operator rather than the member name.
If we're giving this diagnostic because of a typo'd '.' in place of a ';' at
the end of a line, the caret previously pointed at the identifier on the
following line, which isn't as helpful as it could be. Pointing the caret at
the '.' makes it more obvious what the problem is.
llvm-svn: 155267
|
|
|
|
|
|
|
|
|
| |
improving the typo correction results in certain situations.
This is also the first typo correction callback conversion to affect
an existing unit test. :)
llvm-svn: 148140
|
|
|
|
|
|
| |
function. In particular, this restores the cool error recovery for the example from http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html , which regressed a few months back.
llvm-svn: 148089
|
|
|
|
|
|
|
|
|
|
|
| |
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.
llvm-svn: 141738
|
|
|
|
|
|
|
|
| |
We can use this to produce nice diagnostics (and try to fixit-and-recover) in
various cases where we might see "MyFunction" instead of "MyFunction()". The
changes in SemaExpr are an example of how to use isExprCallable.
llvm-svn: 130878
|
|
|
|
| |
llvm-svn: 127061
|
|
|
|
|
|
|
| |
mostly just shuffles various possibilities for recovery into a more
straightforward order, but also unifies a couple of diagnostics.
llvm-svn: 126266
|
|
|
|
|
|
|
| |
function name used as the base of a member expression. Early feedback from
Chandler Carruth, and code review from Nick Lewycky.
llvm-svn: 125714
|
|
|
|
|
|
| |
qualified name. Fixes <rdar://problem/8231724>.
llvm-svn: 109682
|
|
|
|
|
|
|
| |
looking for, reset the name within the LookupResult structure in
addition to clearing out the results. Fixes PR7508.
llvm-svn: 107197
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
introduced by using decls are hidden even if their template parameter lists
or return types differ from the "overriding" declaration.
Propagate using shadow declarations around more effectively when looking up
template-ids. Reperform lookup for template-ids in member expressions so that
access control is properly set up.
Fix some number of latent bugs involving template-ids with totally invalid
base types. You can only actually get these with a scope specifier, since
otherwise the template-id won't parse as a template-id.
Fixes PR7384.
llvm-svn: 106093
|
|
|
|
|
|
|
|
| |
using declaration, look at its underlying declaration to determine the
lookup result kind (e.g., overloaded, unresolved). Fixes at least one
issue in Boost.Bimap.
llvm-svn: 102317
|
|
|
|
|
|
|
| |
member expression (p-> or x.), by showing the type we looked into and
what we did actually find.
llvm-svn: 102315
|
|
|
|
|
|
|
|
|
| |
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
|
|
|
|
|
|
| |
Gets clang-on-clang passing again.
llvm-svn: 90270
|
|
|
|
|
|
|
|
|
|
|
| |
get_origin->x
where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover.
llvm-svn: 86238
|
|
|
|
| |
llvm-svn: 84370
|
|
|
|
|
|
| |
type for C++.
llvm-svn: 72747
|
|
|
|
|
|
|
| |
to a function or function pointer, it's probably because the user
forgot to put in parentheses () to call the function.
llvm-svn: 67826
|
|
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
|
|
|
| |
llvm-svn: 62302
|
|
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.
Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.
llvm-svn: 61294
|