summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
blob: ca28ec8e4435db1b1a630fb928d8fd96d5ed3b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do assemble  }
// Test that failed lvalue-to-rvalue conversion of vf doesn't crash the
// compiler.

class f_class		       // { dg-message "note" "candidates" }
{ };

volatile f_class
ret_v_f_class()
{
  f_class t;
  return t;
}

int main(void)
{
  volatile f_class vf;
  0 ? ret_v_f_class() : vf;	// { dg-error "match" } can't copy volatile lvalue
  // { dg-message "candidate" "candidate note" { target *-*-* } 18 }
  return 0;
}