OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [warn1.C] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
// { dg-options "-Wall" }
3
 
4
// Copyright (C) 2003 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 14 Aug 2003 
6
 
7
// PR 11512. erroneous warnings
8
 
9
template   void Foo(T i)
10
{
11
  i++, i++;
12
  i, i++; // { dg-warning "left-hand operand" "" }
13
  i++, i; // { dg-warning "right-hand operand" "" }
14
  for (;; --i, ++i)
15
    ;
16
}
17
 
18
void Bar ()
19
{
20
  Foo (1);  // { dg-error "instantiated" "" }
21
}
22
 
23
struct M {};
24
 
25
struct C
26
{
27
  M m;
28
  C () :m (M ()) {}
29
};
30
 
31
 
32
void Baz (int i)
33
{
34
  i ? i + 1 : i + 2; // { dg-error "operand of" "" }
35
  i ? i++ : 0;
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.