forward5.fail.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)//===----------------------------------------------------------------------===// 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// The LLVM Compiler Infrastructure 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// This file is dual licensed under the MIT and the University of Illinois Open 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Source Licenses. See LICENSE.TXT for details. 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)//===----------------------------------------------------------------------===// 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// test forward 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <utility> 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)struct A 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles){ 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 171675a649fd7a8b3cb80ffddae2dc181f122353c5Ben Murdoch 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)A source() {return A();} 191320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciconst A csource() {return A();} 201320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 211320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciint main() 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles){ 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const A ca = A(); 24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) std::forward<A>(csource()); // error 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)