Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/crash72.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/29225 |
2 // { dg-do compile } | |
3 | |
4 template <typename L, typename R> bool operator< (L x, R y); | |
5 struct T { int t (); }; | |
6 class S {}; | |
7 | |
8 struct U | |
9 { | |
10 typedef int (T::* M) (); | |
11 M m; | |
12 | |
13 bool operator() (S &x) | |
14 { | |
15 T a; | |
16 return (a.*m) < x; // { dg-error "invalid use of non-static member" } | |
17 } | |
18 }; | |
19 | |
20 void foo (S &x) | |
21 { | |
22 U m; | |
23 m.m = &T::t; | |
24 m (x); | |
25 } |