]> granicus.if.org Git - clang/commit
In C++98/03, when binding a reference to an rvalue of
authorDouglas Gregor <dgregor@apple.com>
Sun, 18 Apr 2010 07:40:54 +0000 (07:40 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 18 Apr 2010 07:40:54 +0000 (07:40 +0000)
commit523d46af407f32fc53861e6f068e8076d4fe84a8
treeb3b5b25735fde4b6b4ae54b2b61a9454aa8aaaf3
parent389980e3602820768714ef2123cb466db3e0d301
In C++98/03, when binding a reference to an rvalue of
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101704 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/Sema.h
lib/Sema/SemaInit.cpp
lib/Sema/SemaInit.h
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p16-cxx0x-no-extra-copy.cpp [new file with mode: 0644]
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-cxx03-extra-copy.cpp [new file with mode: 0644]