2 // { dg-options "-Wall -Weffc++" }
4 //1 g++/12952 un-named variables in a catch block
5 //Wall or Wunused should not give warnings here
18 //2 g++/12923 __attribute__((__unused__)) not working for objects
19 //Weffc++ or Wunused should not report the object as an error
26 C x __attribute__ ((__unused__));
27 int y __attribute__ ((__unused__));
31 //3 g++/12982 lock should not give error here, as above
41 lock () { setLock(); }
42 ~lock () { clearLock(); }
47 lock local __attribute__ ((__unused__));
54 //4 g++/12988 neither Mutex nor AutoMutex varibles should give warnings here
55 //compile with -Weffc++ or -Wunused depending on post or pre 97r1
60 virtual long retcntr() {return counter;};
61 Mutex(int i = 0): counter(i) {};
63 } __attribute__ ((__unused__));
65 class AutoMutex: public Mutex{
69 long retcntr() {return counter2;};
70 AutoMutex(int i = 0): counter2(i) {};
71 virtual ~AutoMutex() {};
72 } __attribute__ ((__unused__));
83 //5 sanity check to make sure other attributes cannot be used
88 virtual long retcntr() {return counter;};
89 Mutex2(int i = 0): counter(i) {};
91 } __attribute__ ((warn)); // { dg-warning "" }