summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash100.C
blob: c67ae2eca38da234047010ad6a79ea1a9839aff3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/44628

template <typename T>
class Temp
{
  int Val;
  public:
  operator T&(void)  { return Val; }

  virtual T& operator=(T a ) // { dg-error "overriding" }
  {
    Val = a;
    return Val;
  }
};

class Int : public Temp<int>
{
  public:
  Int& operator=(int a) // { dg-error "conflicting return type" }
  {
    return (*this);
  }
};