| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reference-compatible type, the implementation is permitted to make a
copy of the rvalue (or many such copies, even). However, even though
we don't make that copy, we are required to check for the presence of
a suitable copy constructor. With this change, we do.
Note that in C++0x we are not allowed to make these copies, so we test
both dialects separately.
Also note the FIXME in one of the C++03 tests, where we are not
instantiating default function arguments for the copy constructor we
pick (but do not call). The fix is obvious; eliminating the infinite
recursion it causes is not. Will address that next.
llvm-svn: 101704
|
| |
|
|
|
|
| |
not issue a warning).
llvm-svn: 101699
|
| |
|
|
|
|
|
|
|
| |
temporary object. This is blindingly obvious from reading C++
[over.match.ctor]p1, but somehow I'd missed it and it took DR152 to
educate me. Adjust one test that was relying on this non-standard
behavior.
llvm-svn: 101688
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
resolution. There are two sources of problems involving user-defined
conversions that this change eliminates, along with providing simpler
interfaces for checking implicit conversions:
- It eliminates a case of infinite recursion found in Boost.
- It eliminates the search for the constructor needed to copy a temporary
generated by an implicit conversion from overload
resolution. Overload resolution assumes that, if it gets a value
of the parameter's class type (or a derived class thereof), there
is a way to copy if... even if there isn't. We now model this
properly.
llvm-svn: 101680
|
| |
|
|
| |
llvm-svn: 101666
|
| |
|
|
|
|
|
|
| |
users of getNameAsString on a stream.
The next step is to print the name directly into the stream, avoiding a temporary std::string copy.
llvm-svn: 101632
|
| |
|
|
|
|
|
|
| |
checking into a single function and use that throughout. Remove some
now unnecessary diagnostics and update tests with now more accurate
diagnostics.
llvm-svn: 101610
|
| |
|
|
|
|
|
| |
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.
llvm-svn: 101576
|
| |
|
|
|
|
|
| |
do *not* suggest that the function could be attribute 'noreturn';
overridden functions may end up returning.
llvm-svn: 101572
|
| |
|
|
|
|
|
| |
This is the last of the uses of TryImplicitConversion outside of
overload resolution and InitializationSequence itself.
llvm-svn: 101569
|
| |
|
|
|
|
| |
Sema::TryImplicitConversion is, for my own sanity. No functionality change
llvm-svn: 101554
|
| |
|
|
|
|
| |
functionality change
llvm-svn: 101550
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TryStaticImplicitCast (for references, class types, and everything
else, respectively) into a single invocation of
InitializationSequence.
One of the paths (for class types) was the only client of
Sema::TryInitializationByConstructor, which I have eliminated. This
also simplified the interface for much of the cast-checking logic,
eliminating yet more code.
I've kept the representation of C++ functional casts with <> 1
arguments the same, despite the fact that I hate it. That fix will
come soon. To satisfy my paranoia, I've bootstrapped + tested Clang
with these changes.
llvm-svn: 101549
|
| |
|
|
|
|
|
|
|
|
| |
functional casts over to InitializationSequence, eliminating a caller
of Sema::TryImplicitConversion. We also get access and ambiguity
checking "for free".
More cleanups to come in this routine.
llvm-svn: 101526
|
| |
|
|
| |
llvm-svn: 101502
|
| |
|
|
| |
llvm-svn: 101498
|
| |
|
|
|
|
| |
SemaOverload.cpp; no functionality change.
llvm-svn: 101497
|
| |
|
|
|
|
| |
that we aren't using ForceRValue any more?
llvm-svn: 101496
|
| |
|
|
| |
llvm-svn: 101495
|
| |
|
|
| |
llvm-svn: 101494
|
| |
|
|
|
|
| |
functions.
llvm-svn: 101492
|
| |
|
|
|
|
| |
not the way we're going to handle this.
llvm-svn: 101483
|
| |
|
|
|
|
| |
Sema::IsUserDefinedConversion. No functionality change
llvm-svn: 101482
|
| |
|
|
|
|
| |
don't need it.
llvm-svn: 101481
|
| |
|
|
| |
llvm-svn: 101464
|
| |
|
|
|
|
|
|
| |
both number seen and number expected.
Finishes fixing PR6501.
llvm-svn: 101442
|
| |
|
|
|
|
|
|
| |
of arguments both seen and expected.
Fixes PR6501.
llvm-svn: 101441
|
| |
|
|
|
|
|
|
|
|
|
| |
intended for redeclarations, fixing those that need it. Fixes PR6831.
This uncovered an issue where the C++ type-specifier-seq parsing logic
would try to perform name lookup on an identifier after it already had
a type-specifier, which could also lead to spurious ambiguity errors
(as in PR6831, but with a different test case).
llvm-svn: 101419
|
| |
|
|
|
|
|
|
| |
in case it ends up doing something that might trigger diagnostics
(template instantiation, ambiguity reporting, access
reporting). Noticed while working on PR6831.
llvm-svn: 101412
|
| |
|
|
| |
llvm-svn: 101384
|
| |
|
|
| |
llvm-svn: 101381
|
| |
|
|
|
|
|
|
|
|
| |
ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for
the width of an integral type. The former includes padding for bools
(to the target's size) while the latter does not, so we woud end up
zero-extending bools to the target width when we shouldn't. Fixes a
crash-on-valid in the included test.
llvm-svn: 101372
|
| |
|
|
|
|
|
| |
that have reference or const scalar members, since those members can
never be initializer or modified. Fixes <rdar://problem/7804350>.
llvm-svn: 101316
|
| |
|
|
|
|
|
|
|
|
| |
ResolveAddressOfOverloadedFunction when asked to complain. Previously,
we had some weird handshake where ResolveAddressOfOverloadedFunction
expected its caller to handle some of the diagnostics but not others,
and yet there was no way for the caller to know which case we were
in. Eliminate this madness, fixing <rdar://problem/7765884>.
llvm-svn: 101312
|
| |
|
|
|
|
|
| |
correction find names when a call failed. Fixes
<rdar://problem/7853795>.
llvm-svn: 101278
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
generally recover from typos in keywords (since we would effectively
have to mangle the token stream). However, there are still benefits to
typo-correcting with keywords:
- We don't make stupid suggestions when the user typed something
that is similar to a keyword.
- We can suggest the keyword in a diagnostic (did you mean
"static_cast"?), even if we can't recover and therefore don't have
a fix-it.
llvm-svn: 101274
|
| |
|
|
|
|
|
|
| |
than just a bool indicating that correction occurred. No actual
functionality change (it's still always used like a bool), but this
refactoring will be used to support typo correction to keywords.
llvm-svn: 101259
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that adds parentheses from the main diagnostic down to a new
note. This way, when the fix-it represents a choice between two
options, each of the options is associted with a note. There is no
default option in such cases. For example:
/Users/dgregor/t.c:2:9: warning: & has lower precedence than ==; ==
will be
evaluated first [-Wparentheses]
if (x & y == 0) {
^~~~~~~~
/Users/dgregor/t.c:2:9: note: place parentheses around the &
expression to
evaluate it first
if (x & y == 0) {
^
( )
/Users/dgregor/t.c:2:9: note: place parentheses around the ==
expression to
silence this warning
if (x & y == 0) {
^
( )
llvm-svn: 101249
|
| |
|
|
| |
llvm-svn: 101212
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
receiver is a mis-typed class name. Previously, we would give a non-specific
typo-correction diagnostic from the expression-parsing code, but there
was no fix-it because it was too late to recover. Now, we give a nice
diagnostic
honk.m:6:4: error: unknown receiver 'Hnk'; did you mean 'Honk'?
[Hnk method];
^~~
Honk
honk.m:1:1: note: 'Honk' declared here
@interface Honk
^
which includes a fix-it.
We still need to recover better from mis-typing "super".
llvm-svn: 101211
|
| |
|
|
|
|
|
| |
are invalid. Prevents a crash-on-invalid during template instantiation.
I... really don't understand how this wasn't already present.
llvm-svn: 101203
|
| |
|
|
|
|
|
| |
measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance
change, but now the vector isn't leaked.
llvm-svn: 101195
|
| |
|
|
| |
llvm-svn: 101173
|
| |
|
|
|
|
| |
for non-fragile abi on darwin.
llvm-svn: 101168
|
| |
|
|
|
|
| |
on objc classes for Darwin. Radar 7839485.
llvm-svn: 101164
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
for reference binding. The code attempted to handle both the
computation of the ICS and the actual conversion, but the latter is an
anachronism: we now use InitializationSequence for that.
Sema::CheckReferenceInit is now a static function TryReferenceInit
that's only use within overload resolution, and has been simplified
slightly. It still needs to be updated per C++ [over.ics.ref], by
eliminating more of the lvalue/rvalue checks.
llvm-svn: 101136
|
| |
|
|
|
|
|
| |
return a NULL expression; return either an error or a proper
expression. Fixes PR6078.
llvm-svn: 101133
|
| |
|
|
|
|
|
| |
direct reference binding when the source and target types are not
reference-related. Fixes PR6066.
llvm-svn: 101132
|
| |
|
|
|
|
| |
members of non-templated classes.
llvm-svn: 101122
|
| |
|
|
|
|
| |
PR6207.
llvm-svn: 101119
|