| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
previously, we were allowing this to bind to a temporary. Now, we
don't; add test-cases and improve diagnostics.
llvm-svn: 94831
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
requires a temporary. Previously, we were building an initialization
sequence that bound to the bit-field as if it were a real lvalue. Note
that we previously (and still) diagnose binding of non-const
references to bit-fields, as we should.
There's no real way to test that this code is correct, since reference
binding does not *currently* have any representation in the AST. This
fix should make it easier for that to happen, so I've verified this
fix with...
Added InitializationSequence::dump(), to print an initialization
sequence for debugging purposes.
llvm-svn: 94826
|
|
|
|
| |
llvm-svn: 94793
|
|
|
|
| |
llvm-svn: 94485
|
|
|
|
| |
llvm-svn: 94427
|
|
|
|
|
|
| |
the bug where array elements and member initializers weren't copied correctly.
llvm-svn: 94340
|
|
|
|
| |
llvm-svn: 94335
|
|
|
|
| |
llvm-svn: 94334
|
|
|
|
| |
llvm-svn: 94332
|
|
|
|
| |
llvm-svn: 94329
|
|
|
|
| |
llvm-svn: 94327
|
|
|
|
|
|
| |
initialization code. Pass an InitializedEntity pointer through to most init checker functions. Right now, it's ignored everywhere except when initializing vectors in C++.
llvm-svn: 94325
|
|
|
|
|
|
| |
Sema::PerformCopyInitialization overload.
llvm-svn: 94324
|
|
|
|
|
|
| |
functionality change.
llvm-svn: 94316
|
|
|
|
|
|
| |
arrays and vectors are pretty different beasts in C++. Doug, please review/comment.
llvm-svn: 94279
|
|
|
|
|
|
|
| |
Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its
own header and make it templated over an inline capacity.
llvm-svn: 93959
|
|
|
|
|
|
|
| |
correctly look through arrays to see cv-qualifiers. Also enhances the routine
for doing this to preserve more type sugaring for diagnostics.
llvm-svn: 93252
|
|
|
|
|
|
|
|
| |
I said to myself, self, why don't you go add a couple of parameters to a method
and then fail to use them, and I thought that sounded like a pretty good idea,
so I did it.
llvm-svn: 93233
|
|
|
|
|
|
|
| |
sequence. Lots of small relevant changes. Fixes some serious problems with
ambiguous conversions; also possibly improves associated diagnostics.
llvm-svn: 93214
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
not just the viable ones. This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls; users
therefore will want to figure out why some other options were excluded.
Started sorting overload results. Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.
Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.
llvm-svn: 92990
|
|
|
|
|
|
|
| |
pointing to the declaration that we found that has that name (if it is
unique).
llvm-svn: 92877
|
|
|
|
|
|
| |
ASTContext. Fixes <rdar://problem/7495428>.
llvm-svn: 92867
|
|
|
|
|
|
|
|
|
|
| |
test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
field in type 'struct Window'; did you mean 'bounds'?
.bunds.
^~~~~
bounds
llvm-svn: 92376
|
|
|
|
|
|
| |
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: 91884
|
|
|
|
| |
llvm-svn: 91882
|
|
|
|
| |
llvm-svn: 91881
|
|
|
|
|
|
| |
since the context is available in the Decl
llvm-svn: 91862
|
|
|
|
|
|
|
| |
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.
llvm-svn: 91858
|
|
|
|
| |
llvm-svn: 91797
|
|
|
|
|
|
| |
over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one
llvm-svn: 91796
|
|
|
|
|
|
|
|
| |
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.
llvm-svn: 91767
|
|
|
|
|
|
|
|
|
|
| |
InitializationSequence. Specially, switch initialization of a C++
class type (either copy- or direct-initialization).
Also, make sure that we create an elidable copy-construction when
performing copy initialization of a C++ class variable. Fixes PR5826.
llvm-svn: 91750
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:
- InitializationSequence now has a "C conversion sequence" category
and step kind, which falls back to
- Changed the diagnostics for returns to always have the result type
of the function first and the type of the expression second.
CheckSingleAssignmentConstraints to peform checking in C.
- Improved ASTs for initialization of return values. The ASTs now
capture all of the temporaries we need to create, but
intentionally do not bind the tempoary that is actually returned,
so that it won't get destroyed twice.
- Make sure to perform an (elidable!) copy of the class object that
is returned from a class.
- Fix copy elision in CodeGen to properly see through the
subexpressions that occur with elidable copies.
- Give "new" its own entity kind; as with return values and thrown
objects, we don't bind the expression so we don't call a
destructor for it.
Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.
llvm-svn: 91669
|
|
|
|
|
|
|
| |
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.
llvm-svn: 91548
|
|
|
|
|
|
| |
InitializationSequence
llvm-svn: 91542
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
InitializationSequence to perform the actual initialization.
Also, introduced the notion of a tree of initialized entities, so that
we can know where an initialization began when dealing with nested
initializations (as occur when performing list initialization). This
will, eventually, be useful for producing better diagnostics when list
initialization fails, because we can show the path from the top-level
object being initialized down to the actual subobject where
initialization failed.
llvm-svn: 91516
|
|
|
|
| |
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
|
|
|
|
|
|
| |
WIP, yet again.
llvm-svn: 91368
|
|
|
|
| |
llvm-svn: 91325
|
|
|
|
| |
llvm-svn: 91323
|
|
|
|
|
|
| |
isn't turned on anyway yet, so it cannot be tested.
llvm-svn: 91294
|
|
|
|
| |
llvm-svn: 91234
|
|
|
|
|
|
| |
no extra safety anyway.
llvm-svn: 91207
|
|
|
|
| |
llvm-svn: 91097
|
|
|
|
| |
llvm-svn: 91050
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.
Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:
p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~
p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~
p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~
p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^
llvm-svn: 90992
|