summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-4.C
blob: 9018e92ef948ca30e3e5fd30c40a368e4715cf05 (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
25
26
27
28
29
30
// { dg-do compile }
// { dg-options "-Wunused-parameter" }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Sep 2003 <nathan@codesourcery.com>
// Origin: yotamm@mellanox.co.il


// PR c++/9848. Missing warning

struct C1 {
  // Only use in-charge ctor
  C1(int bi) {}  // { dg-warning "unused parameter" "" }
};
struct C2 {
  // Only use base ctor
  C2(int bi) {}  // { dg-warning "unused parameter" "" }
};

struct D : C2
{
  D (int) : C2 (1) {}
};

void show_compile_warning ()
{
  C1 c1 (1);
  
  D d (1);
}