language: C++11 (gcc-4.7.2)
date: 613 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
class BClass {};
 
template <typename Type> class AClass {
  public:
  virtual const Type aMethod() const { return Type(); }
};
int main() {
  return AClass<BClass const&>().aMethod() ,0;
}
prog.cpp: In member function 'const Type AClass<Type>::aMethod() const [with Type = const BClass&]':
prog.cpp:8:42:   instantiated from here
prog.cpp:5:52: error: invalid value-initialization of reference types