OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [attrib4.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// { dg-options "-Wformat" }
3
// Test that attributes are really applied to function declarations under
4
// various conditions.
5
// Contributed by Jason Merrill (jason@cygnus.com)
6
 
7
#define PF __attribute__ ((format (printf, 1, 2)))
8
 
9
struct A {
10
  static PF void f (const char *, ...);
11
  static PF void g (const char *, ...) { }
12
  static void test ();
13
};
14
 
15
void PF h (const char *, ...);
16
void PF k (const char *, ...) { }
17
 
18
void A::test ()
19
{
20
  f ("%f", 42);                 // { dg-warning "argument 2" }
21
  g ("%f", 42);                 // { dg-warning "argument 2" }
22
  h ("%f", 42);                 // { dg-warning "argument 2" }
23
  k ("%f", 42);                 // { dg-warning "argument 2" }
24
}

powered by: WebSVN 2.1.0

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