Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/template/crash72.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
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 } |