Debian Codegraph @

gcc/testsuite/g++.dg/ext/attr-format1.C

raw
1 // PR c++/47634
2 // { dg-do compile }
3
4 class Base {
5 public:
6 Base() { }
7 };
8
9 class VDerived : public virtual Base {
10 public:
11 VDerived(int x, const char * f, ...) __attribute__((format(printf, 3, 4)));
12 };
13
14 class Derived : public Base {
15 public:
16 Derived(int x, const char * f, ...) __attribute__((format(printf, 3, 4)));
17 };
18
19 VDerived::VDerived(int, const char *, ...)
20 {
21 }
22
23 Derived::Derived(int, const char *, ...)
24 {
25 }
26
27 int
28 main(int, char **)
29 {
30 throw VDerived(1, "%s %d", "foo", 1);
31 throw Derived(1, "%s %d", "bar", 1);
32 }