History log of /external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1fd1e288d0f45b86d191d8f53f569e5143f3a18a 11-Apr-2013 Jordan Rose <jordan_rose@apple.com> Force a load when creating a reference to a temporary copied from a bitfield.

For this source:
const int &ref = someStruct.bitfield;

We used to generate this AST:

DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'const int' lvalue <NoOp>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Notice the lvalue inside the MaterializeTemporaryExpr, which is very
confusing (and caused an assertion to fire in the analyzer - PR15694).

We now generate this:

DeclStmt [...]
`-VarDecl [...] ref 'const int &'
`-MaterializeTemporaryExpr [...] 'const int' lvalue
`-ImplicitCastExpr [...] 'int' <LValueToRValue>
`-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
`-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Which makes a lot more sense. This allows us to remove code in both
CodeGen and AST that hacked around this special case.

The commit also makes Clang accept this (legal) C++11 code:

int &&ref = std::move(someStruct).bitfield

PR15694 / <rdar://problem/13600396>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
defa32ef4fdc166d39d2d0859e5edbd78da2ddd0 27-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13278115> Improve diagnostic when failing to bind an rvalue reference to an lvalue of compatible type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
5f31f0893d75203c326ddcd9808099bbfe34aec0 18-Oct-2011 David Blaikie <dblaikie@gmail.com> Switch to the C++11 warning flags in tests.
Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
762bb9d0ad20320b9f97a841dce57ba5e8e48b07 14-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
203050c2d5413c3f7e18dfa39451bf6f954136ca 05-Oct-2011 Douglas Gregor <dgregor@apple.com> Don't allow an rvalue reference to bind to the result of a calling a
conversion function whose result type is an lvalue reference. The
initialization code already handled this properly, but overload
resolution was allowing the binding. Fixes PR11003 /
<rdar://problem/10233078>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
f20d27288c7f124dcc9c50c7c6bf766d522ceb31 15-Aug-2011 Douglas Gregor <dgregor@apple.com> Teach reference initialization from the result of a user-defined
conversion to initialize the standard conversion *after* the
user-defined conversion properly. Fixes PR10644.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
8dde14e7f43a4b29e592b3e8e576eb467ddb6c6e 24-Jan-2011 Douglas Gregor <dgregor@apple.com> Re-instate r123977/r123978, my updates of the reference-binding
implementation used by overload resolution to support rvalue
references. The original commits caused PR9026 and some
hard-to-reproduce self-host breakage.

The only (crucial!) difference between this commit and the previous
commits is that we now properly check the SuppressUserConversions flag
before attempting to perform a second user-defined conversion in
reference binding, breaking the infinite recursion chain of
user-defined conversions.

Rvalue references should be working a bit better now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
aa5952c53f6c6a844a22fa2294186e16018b31e1 22-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> revert r123977 and r123978 to fix PR9026.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
68ed68b227c25babfbdd38d9a5b4b423d501951f 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Update the reference-binding implementation used for overload
resolution to match the latest C++0x working paper's semantics. The
implementation now matching up with the reference-binding
implementation used for initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
00d66cce52cf027eac77591a9847f87dacf36995 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Add more reference-binding examples from the C++0x working paper, all of which seem to be working fine

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
b2855ad68d93824faf47c09bbef90ba74157f0f4 21-Jan-2011 Douglas Gregor <dgregor@apple.com> More work to bring reference binding up to the latest C++0x
specification. In particular, an rvalue reference can bind to an
initializer expression that is an lvalue if the referent type and the
initializer expression type are not reference-related. This is a newer
formulation to the previous "rvalue references can never bind to
lvalues" rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
564cb06b1f010ab3c5e316ac79ba6cfdd72e9c1d 21-Jan-2011 Douglas Gregor <dgregor@apple.com> When performing reference binding via a conversion function, perform
type checking based on the actual reference type we're trying to bind
the result to, rather than stripping the reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
35e99fa40f1245cc554d8a26373e0486eb9c28f2 20-Jan-2011 Douglas Gregor <dgregor@apple.com> More tests for reference binding in the presence of rvalue
references. Note that we're currently failing reference binding to a
function lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
c5db24dfbc860a9fd1501c72f398bf6b6d5b6e0e 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Start refactoring reference binding to more closely match the C++0x
working paper's structure. The only functional change here is that we
now handling binding to array rvalues, which we would previously reject.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
69d831645f429d3b806d2ae220aee45ca44f8c6c 20-Jan-2011 Douglas Gregor <dgregor@apple.com> Add some tests for reference-collapsing and referencing binding
involving rvalue references, to start scoping out what is and what
isn't implemented. In the process, tweak some standards citations,
type desugaring, and teach the tentative parser about && in
ptr-operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp