[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / template / warn1.C
blob53b04ec6b86865bd3e62b50f587e067a050c8af7
1 // { dg-do compile }
2 // { dg-options "-Wall" }
4 // Copyright (C) 2003 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 14 Aug 2003 <nathan@codesourcery.com>
7 // PR 11512. erroneous warnings
9 template <class T>  void Foo(T i) 
10
11   i++, i++;
12   i, i++; // { dg-warning "left operand" }
13   i++, i; // { dg-warning "right operand" }
14   for (;; --i, ++i)
15     ;
16
18 void Bar ()
19
20   Foo (1);  // { dg-message "required" }
23 struct M {};
25 struct C
27   M m;
28   C () :m (M ()) {}
32 void Baz (int i)
34   i ? i + 1 : i + 2; // { dg-warning "operand of" }
35   i ? i++ : 0;