| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 93287
|
| |
|
|
|
|
| |
ivar name lookup. Fixes pr5986.
llvm-svn: 93271
|
| |
|
|
|
|
|
|
|
|
| |
unevaluated contexts, because they only matter for code that will
actually be evaluated at runtime.
As part of this, I had to extend PartialDiagnostic to support fix-it
hints.
llvm-svn: 93266
|
| |
|
|
|
|
| |
not in an evaluated context. This removes some bogus warnings.
llvm-svn: 93258
|
| |
|
|
| |
llvm-svn: 93256
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given
struct X { template<typename T> operator T*(); } x;
when we call
x.operator int*();
we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,
template<> X::operator float*() { /* ... */ }
and when calling or otherwise naming a conversion function (as in the
first example).
This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.
llvm-svn: 93162
|
| |
|
|
|
|
| |
function. Fixes PR5985.
llvm-svn: 93150
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:
t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
[-Wparentheses]
if (i & j == k) {
^~~~~~~~
( )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
if (i & j == k) {
^
( )
t.cpp:14:9: warning: using the result of an assignment as a condition
without
parentheses [-Wparentheses]
if (i = f()) {
~~^~~~~
( )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
if (i = f()) {
^
==
llvm-svn: 92975
|
| |
|
|
|
|
|
| |
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.
llvm-svn: 92958
|
| |
|
|
|
|
|
| |
pointing to the declaration that we found that has that name (if it is
unique).
llvm-svn: 92877
|
| |
|
|
| |
llvm-svn: 92677
|
| |
|
|
| |
llvm-svn: 92676
|
| |
|
|
| |
llvm-svn: 92541
|
| |
|
|
|
|
|
| |
whose operands are non-negative integer constant expressions. This comes up
in LLVM in a few places.
llvm-svn: 92525
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
constructs:
- Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
- Property name lookup ("foo.prop")
- Superclasses
- Various places where a class name is required
- Protocol names (e.g., id<proto>)
This seems to cover many of the common places where typos could occur.
llvm-svn: 92449
|
| |
|
|
|
|
| |
coverage.
llvm-svn: 92433
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:
test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
mean 'NSString'?
NSstring *str = @"A string";
...
^
1 diagnostic generated.
llvm-svn: 92379
|
| |
|
|
|
|
| |
s.fnd("hello")
llvm-svn: 92345
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
you mean 'radius'?
return radious * pi;
^~~~~~~
radius
This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.
llvm-svn: 92341
|
| |
|
|
|
|
| |
C++2.13.2p2: "A wide-character literal has type wchar_t"
llvm-svn: 92313
|
| |
|
|
|
|
|
| |
call; the standard doesn't expect us to, and the program could be doing
something crazy. Fixes PR5882.
llvm-svn: 92166
|
| |
|
|
| |
llvm-svn: 92162
|
| |
|
|
|
|
| |
implicit "this" expressions
llvm-svn: 92141
|
| |
|
|
|
|
|
|
| |
argument-passing doesn't have to. Fixes PR5867, where we were binding
a temporary twice in the AST and, therefore, calling its destructor
twice.
llvm-svn: 92131
|
| |
|
|
|
|
|
| |
denormal, but we only want to diagnose if we underflowed to zero. This
allows people to write constants in the denormal range.
llvm-svn: 92129
|
| |
|
|
| |
llvm-svn: 92127
|
| |
|
|
|
|
|
|
| |
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.
llvm-svn: 92078
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
member function thereof), perform the template instantiation each time
the default argument is needed. This ensures that
(1) We get different CXXTemporary objects for each instantiation, and
(2) Any other instantiations or definitions triggered by the
instantiation of the default argument expression are guaranteed to
happen; previously, they might have been suppressed, e.g., because
they happened in an unevaluated context.
This fixes the majority of PR5810. However, it does not address the
problem where we may have multiple uses of the same CXXTemporary
within an expression when the temporary came from a non-instantiated
default argument expression.
llvm-svn: 92015
|
| |
|
|
|
|
| |
don't have a FunctionDecl) over to InitializationSequence.
llvm-svn: 91906
|
| |
|
|
|
|
| |
use the location information but we did spend a bunch of time building faked-up TypeLocs
llvm-svn: 91905
|
| |
|
|
|
|
|
|
|
|
|
| |
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:
- Make sure to use the adjusted parameter type for initialization of
function parameters.
- Implement transparent union calling semantics in C
llvm-svn: 91902
|
| |
|
|
| |
llvm-svn: 91882
|
| |
|
|
|
|
| |
before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments.
llvm-svn: 91870
|
| |
|
|
|
|
| |
since the context is available in the Decl
llvm-svn: 91862
|
| |
|
|
|
|
| |
as a g++ extension (fixes radar 7481987).
llvm-svn: 91827
|
| |
|
|
|
|
|
|
|
|
| |
dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution. In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.
llvm-svn: 91747
|
| |
|
|
|
|
| |
with "declared at" rather than "previous declaration is here".
llvm-svn: 91699
|
| |
|
|
|
|
|
|
|
| |
function in a C++ call using an arbitrary call-expression type.
Actually exploit this to fix the recovery implemented earlier.
The diagnostic is still iffy, though.
llvm-svn: 91538
|
| |
|
|
|
|
|
|
|
| |
used as expressions). In dependent contexts, try to recover by doing a lookup
in previously-dependent base classes. We get better diagnostics out, but
unfortunately the recovery fails: we need to turn it into a method call
expression, not a bare call expression. Thus this is still a WIP.
llvm-svn: 91525
|
| |
|
|
| |
llvm-svn: 91503
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
than using its own partial implementation of initialization.
Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.
Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.
Implemented support for default initialization in
InitializationSequence.
Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.
Taught CXXConstructExpr to store more location information.
llvm-svn: 91492
|
| |
|
|
|
|
| |
using objective-c property. (fixes radar 7449707)
llvm-svn: 91474
|
| |
|
|
|
|
|
|
|
| |
non-existing 'isa' field of a non-existing struct type
all related to legacy type definition for 'id' which we have
dropped in clang in favor of a built-in type.
(fixes radar 7470820).
llvm-svn: 91455
|
| |
|
|
|
|
| |
underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates.
llvm-svn: 91439
|
| |
|
|
|
|
|
| |
For hi/odd of an odd-length vector, the last component is undefined. Since
we shuffle with an undef vector, no CodeGen needs to change to support this.
llvm-svn: 91437
|
| |
|
|
| |
llvm-svn: 91433
|
| |
|
|
|
|
|
| |
note_previous_decl was used where note_previous_declaration was intended. Better
names or PR5785 might be nice.
llvm-svn: 91413
|
| |
|
|
|
|
|
|
| |
in a potentially potentially evaluated context, queue those
diagnostics and only emit them if the context ends up being
potentially evaluated. This completes the fix for PR5761.
llvm-svn: 91213
|
| |
|
|
|
|
|
|
| |
__builtin_offsetof, passing through an ellipsis) when we're in an
unevaluated context. This is the first part of the fix to PR5761,
which deals with the simple case of an unevaluated context.
llvm-svn: 91210
|
| |
|
|
|
|
| |
into its own helper method. No change in functionality.
llvm-svn: 91056
|