summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-0x.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Sema] Improved diagnostic for qualifiers in reference bindingAnastasia Stulova2019-06-211-2/+2
| | | | | | | | | Improved wording and also simplified by using printing method from qualifiers. Differential Revision: https://reviews.llvm.org/D62914 llvm-svn: 364023
* Fix typo from r237482. "to reference of type" --> "to reference to type"Richard Trieu2015-05-161-1/+1
| | | | llvm-svn: 237507
* When emitting a dropped qualifier error, show which qualifiers are dropped.Richard Trieu2015-05-161-1/+1
| | | | llvm-svn: 237505
* Reverse the order of types in the reference dropping qualifiers error.Richard Trieu2015-05-151-1/+1
| | | | | | | | The error has the form ... 'int' ... 'const int' ... dropped qualifiers. At first glance, it appears that the const qualifier is added. Reverse the types so that the second type is less qualified than the first. llvm-svn: 237482
* Force a load when creating a reference to a temporary copied from a bitfield.Jordan Rose2013-04-111-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> llvm-svn: 179250
* <rdar://problem/13278115> Improve diagnostic when failing to bind an rvalue ↵Douglas Gregor2013-03-261-0/+8
| | | | | | reference to an lvalue of compatible type. llvm-svn: 178095
* Switch to the C++11 warning flags in tests. David Blaikie2011-10-181-1/+1
| | | | | | Patch by Ahmed Charles! llvm-svn: 142340
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Don't allow an rvalue reference to bind to the result of a calling aDouglas Gregor2011-10-041-4/+19
| | | | | | | | | 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>. llvm-svn: 141137
* Teach reference initialization from the result of a user-definedDouglas Gregor2011-08-151-0/+15
| | | | | | | conversion to initialize the standard conversion *after* the user-defined conversion properly. Fixes PR10644. llvm-svn: 137608
* Re-instate r123977/r123978, my updates of the reference-bindingDouglas Gregor2011-01-241-1/+33
| | | | | | | | | | | | | | | | 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. llvm-svn: 124121
* revert r123977 and r123978 to fix PR9026.Rafael Espindola2011-01-221-33/+1
| | | | llvm-svn: 124033
* Update the reference-binding implementation used for overloadDouglas Gregor2011-01-211-1/+33
| | | | | | | | resolution to match the latest C++0x working paper's semantics. The implementation now matching up with the reference-binding implementation used for initialization. llvm-svn: 123977
* Add more reference-binding examples from the C++0x working paper, all of ↵Douglas Gregor2011-01-211-3/+28
| | | | | | which seem to be working fine llvm-svn: 123955
* More work to bring reference binding up to the latest C++0xDouglas Gregor2011-01-211-1/+25
| | | | | | | | | | 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. llvm-svn: 123952
* When performing reference binding via a conversion function, performDouglas Gregor2011-01-211-4/+3
| | | | | | | type checking based on the actual reference type we're trying to bind the result to, rather than stripping the reference. llvm-svn: 123950
* More tests for reference binding in the presence of rvalueDouglas Gregor2011-01-201-0/+27
| | | | | | | references. Note that we're currently failing reference binding to a function lvalue. llvm-svn: 123920
* Start refactoring reference binding to more closely match the C++0xDouglas Gregor2011-01-201-3/+22
| | | | | | | working paper's structure. The only functional change here is that we now handling binding to array rvalues, which we would previously reject. llvm-svn: 123918
* Add some tests for reference-collapsing and referencing bindingDouglas Gregor2011-01-201-0/+38
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. llvm-svn: 123913
OpenPOWER on IntegriCloud