Show pertinent parameter (PR c++/85110)
[official-gcc.git] / gcc / testsuite / g++.dg / diagnostic / aka2.C
blobd7a3b3522cdff21d7f11bee1dd1d9ccd77242fb9
1 /* Verify that the "aka" descriptions for typedefs are correctly
2    quoted (PR 62170).  */
4 /* Exercise %H and %I.  */
6 typedef struct s1 t1;
7 typedef struct s2 {int i;} t2;
9 int foo(t1 *);
11 void test_1 () {
12   t2 pos;
14   foo (&pos); // { dg-error "cannot convert 't2\\*' {aka 's2\\*'} to 't1\\*' {aka 's1\\*'}" }
17 /* Exercise %T.  */
19 typedef struct s3
20 {  
21   void m3 ();
22 } t3;
24 void test_2 (const s3 *ptr)
26   ptr->m3 (); // { dg-error "passing 'const s3' as 'this' argument discards qualifiers" }
29 void test_3 (const t3 *ptr)
31   ptr->m3 (); // { dg-error "passing 'const t3' {aka 'const s3'} as 'this' argument discards qualifiers" }