plateform
stringclasses
1 value
repo_name
stringclasses
2 values
name
stringlengths
1
78
ext
stringclasses
2 values
path
stringlengths
15
1.11k
size
int64
1
8.55M
source_encoding
stringclasses
11 values
md5
stringlengths
32
32
text
stringlengths
0
8.49M
google
chromium
pr12242
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr12242.C
1,443
utf_8
ce1abb041d2bb27e9f937c6116b0ee0b
// PR 12242: should warn about out-of-range int->enum conversions // { dg-do compile } // { dg-options "-Wconversion -fpermissive" } enum X { A }; enum Y { B, C, D }; void example () { int i = 5; X x; Y y; x = 10; // { dg-warning "invalid conversion from .int. to .X." } // { dg-warning "unspecifi...
google
chromium
Wstrict-aliasing-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-1.C
161
utf_8
44dc4b5572b60846a2322e12b0510783
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ double x; int *foo(void) { return (int *)&x; /* { dg-warning "strict-aliasing" } */ }
google
chromium
Wparentheses-13
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-13.C
1,593
utf_8
9ec8d4fa497036c260fb5d2dbf4ff336
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-1.C. int foo (int); int a, b, c; bool d; template<class T> void bar (T) { if (a = b) // { dg-warning "assignment" "correct warning" } foo (0); if ((a = b)) foo (1); if (a = a) // { dg-warning "assignment" "corre...
google
chromium
Wtype-limits
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wtype-limits.C
3,287
utf_8
22df2210e32160eed4b3f51bb9773e8b
/* { dg-do compile } */ /* { dg-options "-Wtype-limits" } */ extern void assert (int); void a (unsigned char x) { if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" ...
google
chromium
Wunused-10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-10.C
142
utf_8
09723811a7331dcc7580068bdfe05710
// PR c++/19190 // { dg-options "-Wunused" } struct breakme { void setAction( unsigned char a ) { act = a; } unsigned int act:8; };
google
chromium
deprecated-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/deprecated-3.C
307
utf_8
2fc2da2424134931e2b72759c1c0e59d
/* PR 17947 bad warning with implicit conversion and __attribute__((deprecated)) */ /* { dg-do compile } */ /* { dg-options "" } */ struct Foo { operator int() __attribute__((deprecated)); }; void g(void) { Foo f; (int)f; // { dg-warning "'Foo::operator int\\(\\)' is deprecated \\(declared at" } }
google
chromium
Warray-bounds-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Warray-bounds-4.C
921
utf_8
c5f8d177b95311df0a23b28f8373351d
// { dg-do compile } // { dg-options "-O2 -Warray-bounds" } class String { public: virtual unsigned long length() const = 0; virtual char get(unsigned long index) const = 0; virtual void set(unsigned long index, char value) = 0; virtual char& operator[] (unsigned long value) = 0; virtual ~String() {}; }; te...
google
chromium
deprecated-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/deprecated-4.C
159
utf_8
98c2c2dc0644115f45902f826dc56a04
// PR c++/15269 struct B { virtual int foo() __attribute__((deprecated)); }; int main(void) { ((B*)0)->foo(); // { dg-warning "deprecated" } }
google
chromium
Wextra-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wextra-3.C
379
utf_8
7261164c9598bc81ae5d66213779d5d4
// PR c++/45278 // { dg-options "-Wextra" } extern void* p; int f1() { return ( p < 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" } int f2() { return ( p <= 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" } int f3() { return ( p > 0 ? 1 : 0 ); } // { dg-warning "ordered comparison" } int f4() { return ( ...
google
chromium
ctor-init-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/ctor-init-1.C
148
utf_8
85dc72a0303b57c698ce2804c195f5b0
// PR c++/11554 // { dg-options "-Wall" } struct Y { Y (); int i1, i2; // { dg-warning "" } }; Y::Y () : i2(0), i1(0) {} // { dg-warning "" }
google
chromium
register-var-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/register-var-1.C
296
utf_8
91dd53b7d7d2954e6728c3851a3a75e9
/* PR/18160 */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* This should yield an error even without -pedantic. */ /* { dg-options "-ansi" } */ void g(int *); void f(void) { register int x __asm ("eax"); g(&x); /* { dg-error "address of explicit register variable" } */ }
google
chromium
Wstrict-aliasing-6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-6.C
166
utf_8
c92cdb0aebb5d139da6039eb73219857
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ int foo () { char buf[8]; return *((int *)buf); /* { dg-warning "strict-aliasing" } */ }
google
chromium
deprecated
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/deprecated.C
3,818
utf_8
966c33cf349322b3b99faf7895c5cca3
/* Test __attribute__ ((deprecated)) */ /* { dg-do compile } */ /* { dg-options "-Wdeprecated-declarations -fmessage-length=0" } */ #if 1 typedef int INT1 __attribute__((deprecated)); typedef INT1 INT2 __attribute__ ((__deprecated__)); typedef INT1 INT1a; /* { dg-warning "'INT1' is deprecated" "" } */ typedef INT1...
google
chromium
ctor1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/ctor1.C
165
utf_8
450b64494a8df8181368be08d23e5bf9
// PR c++/35734 // { dg-options "-W" } struct A { A(); template<typename T> A(const T&); }; struct B : A { B(const B&) {} // { dg-warning "base class" } };
google
chromium
Wchar-subscripts
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wchar-subscripts.C
228
utf_8
405a43ec2fe3003f95668d54092d08b1
// { dg-do compile } // { dg-options "-Wchar-subscripts" } int main() { int ary[256] = { 0 }; return ary['a']; }
google
chromium
conv4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/conv4.C
251
utf_8
e668b1c05f8d62f23aa769b40e21b385
// { dg-do compile } // This file should compile cleanly by default and not warn on the conversions. int func1(int i) { return i; } int main() { float f; long l; unsigned long ul; f = 1.5f; l = f; ul = -1; func1(f); return 0; }
google
chromium
Wreturn-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-1.C
171
utf_8
39d7f3f2b6a28c609038dedf0f24d03c
// { dg-options "-Wreturn-type" } // PR c++/15742 extern void exit(int) __attribute__ ((noreturn)); template<typename T> struct A { int find_cmp(void) { exit(1); } };
google
chromium
unused-result1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/unused-result1.C
265
utf_8
9a6d1f8015d3d00bff470112bad3f07e
// PR c++/27371 class QByteArray { public: QByteArray(const QByteArray &); }; class QString { QByteArray toLocal8Bit() const __attribute__ ((warn_unused_result)); void fooWarnHere() const { toLocal8Bit(); } // { dg-warning "ignoring" "" { xfail *-*-* } } };
google
chromium
Wtype-limits-Wextra
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C
3,334
utf_8
633c61179699c1cca2e51dfaf2b48aa2
/* Test that -Wtype-limits is enabled by -Wextra. */ /* { dg-do compile } */ /* { dg-options "-Wextra" } */ extern void assert (int); void a (unsigned char x) { if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */ if (x >= 0) return;/* { dg-warning "comparison is ...
google
chromium
implicit-typename2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/implicit-typename2.C
246
utf_8
f69540cf16bb392d5bf1e5edfc8e067e
// { dg-do compile } // PR c++/11039: Implicit typename warning in friend class declaration. template <typename T> struct X { struct Y { struct Z {}; }; friend struct Y::Z; };
google
chromium
miss-format-6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/miss-format-6.C
952
utf_8
aa07b1519cde34fc8f8e23f6aa2bb1ab
/* { dg-do compile } */ /* { dg-options "-Wmissing-format-attribute" } */ /* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */ #include <stdarg.h> typedef void (*noattr_t) (const char *, ...); typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t; typedef void (*vnoattr_t) (co...
google
chromium
noreturn-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/noreturn-4.C
196
utf_8
779a5460d67225b277c3918f1550c055
// PR c++/30988 // { dg-do compile } // { dg-options "-O2 -Wall" } void f (const char *) __attribute__ ((noreturn)); template <typename T> struct A { int g () { f (__FUNCTION__); } };
google
chromium
Wstrict-aliasing-bogus-union
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-union.C
241
utf_8
81024e5e796ea1637204d6a421f3c1bb
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ union U { int i; float f; }; float foo () { union U u; float* f = &u.f; /* { dg-bogus "unions are holy in GCC" } */ u.i = 2; return *f; }
google
chromium
main-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/main-3.C
130
utf_8
43a7ad018e2ced981acc916d2df8f96b
// PR c++/29735 // { dg-do compile } int __attribute__ ((vector_size (8))) main () // { dg-error "must return" } { return 0; }
google
chromium
Wshadow-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wshadow-2.C
166
utf_8
6a6527871d476c4275232fa53d041994
/* { dg-options "-Wshadow" } */ struct A { void a1 () { struct B { B() {} }; // There should be no warning here. } void a2 () { struct B { }; } };
google
chromium
Wbraces1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wbraces1.C
105
utf_8
d489a76c7b7ab5b0e165f2342a4e6974
// PR c++/19755 // { dg-options "-Wmissing-braces" } int a[2][2] = { 0, 1 , 2, 3 }; // { dg-warning "" }
google
chromium
Wstrict-aliasing-bogus-escape
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-escape.C
330
utf_8
fd3e58149ce1fbe517a6bbeb205ae2d9
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing" } */ #include <string> #include <list> class A; class B { public: void foo(A&); std::string s; }; class A { public: A& qaz() { l.push_back( new A() ); return *l.back(); } std::list<A*> l; }; void bar() { A a; B b; b.foo(a.q...
google
chromium
deprecated-6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/deprecated-6.C
5,294
utf_8
9f3101ee1ded355e1947b609e4eb51a9
/* Test __attribute__ ((deprecated("message"))) */ /* { dg-do compile } */ /* { dg-options "-Wdeprecated-declarations -fmessage-length=0" } */ typedef int INT1 __attribute__((deprecated("Please avoid INT1"))); typedef INT1 INT2 __attribute__ ((__deprecated__("Please avoid INT2"))); typedef INT1 INT1a; /* { dg-warn...
google
chromium
format3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/format3.C
209
utf_8
449301e4fc095134d15ba50f081d6eb2
// PR c++/13070 // { dg-do compile } // { dg-options "-Wformat" } extern "C" int printf (const char*, ...); int main() { printf("%d\n", 1, 1); // { dg-warning "too many" "printf warning" } return 0; }
google
chromium
pr31246
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr31246.C
217
utf_8
f2ddacc862e1b84e2cbd0983426410d2
// PR 31246 // { dg-do compile } // { dg-options "-Wunreachable-code -D_GLIBCXX_DEBUG" } // { dg-xfail-if "lack of weak symbols" { alpha*-dec-osf* } } #include <vector> int main() { std::vector<int>::iterator a; }
google
chromium
noreturn-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/noreturn-1.C
835
utf_8
acf9323dc369473d47e1a02ca5461933
// Test that noreturn attributes are properly set. // { dg-do compile } // { dg-options "-Wall -O2" } #include <cstdlib> int foo1 (int i) { switch (i) { case 1: case 2: return i; } abort(); } int foo2 (int i) { switch (i) { case 1: case 2: return i; } std::abort(); } ...
google
chromium
forward-inner
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/forward-inner.C
2,238
utf_8
1f0476e3269f2970342394b1b77e8639
// Check that the compiler warns about inner-style forward declarations in // contexts where they're not actually illegal, but merely useless. // Verify warnings for and within classes, and by extension, struct and union. class C1; class C1::C2; // { dg-error "does not name a type" } class C1::C2::C3; // { dg-er...
google
chromium
Winline-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Winline-3.C
114
utf_8
e5e6d08567eb0a03fffadca1da754cde
// { dg-options "-Winline -O" } #include <vector> using namespace std; int main(void) { vector<int> v(10); }
google
chromium
Wshadow-7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wshadow-7.C
1,168
utf_8
d8a57046ae0a99518a6eb13f0432a9d5
// PR c++/44128 // { dg-options "-Wshadow" } typedef long My_ssize_t; // { dg-warning "shadowed declaration" } typedef int Foo; // { dg-warning "shadowed declaration" } struct Bar1 { // { dg-bogus "shadowed declaration" } int a; }; struct Bar2 { // { dg-warning "shadowed declaration...
google
chromium
Wparentheses-7
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-7.C
2,882
utf_8
6123d47b0c90e76bcd5c6a33cbd024bd
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ copy of gcc.dg/Wparentheses-4.c int foo (int); int bar (int a, int b, int c) { foo (a + b << c); // { dg-warning "parentheses" "correct warning" } foo ((a + b) << c); foo (a + (b << c)); foo (1 + 2 << c); // { dg-warning "parentheses" "correct war...
google
chromium
pr36954
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr36954.C
266
utf_8
3a48dd59b8100807ad118969f8c0e7e3
// PR c++/36954 // { dg-do compile } // { dg-options "-Wlogical-op -Wextra -Wall" } template<class C> void Test() { if ((1 == 2) || (true)) { } if ((1 == 2) || (!false)) { } if (false || true) { } } int main() { if ((1 == 2) || (true)) { } }
google
chromium
pr13358-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr13358-4.C
1,176
utf_8
f0315b9c8746246ea3256e97df8805a0
// PR c++/13358: g++ should accept a long long constant sans LL suffix // if -Wno-long-long is in use. // { dg-do compile } // { dg-require-effective-target int32plus } // { dg-options "-std=c++0x -pedantic-errors -Wlong-long" } void use_longlong () { unsigned long long x1, x2, x3; // { dg-warning "ISO C\\+\\+ 199...
google
chromium
Wuninitialized-5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C
349
utf_8
1f013ef9d737e679cea70e842d47a7ce
// PR middle-end/39666 // { dg-do compile } // { dg-options "-O2 -Wuninitialized" } int foo (int i) { int j; switch (i) { case -__INT_MAX__ - 1 ... -1: j = 6; break; case 0: j = 5; break; case 2 ... __INT_MAX__: j = 4; break; } return j; // { dg-warning "ma...
google
chromium
Winline-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Winline-1.C
139
utf_8
99a0635e430cefd28c2908b5aaf4a487
// { dg-options "-Winline -O2" } static inline int foo(int x); int main() { return(foo(17)); } inline int foo(int x) { return(x); }
google
chromium
Wextra-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wextra-1.C
421
utf_8
d267dddcbfdc3e1208a643c82d1c0886
// { dg-options "-Wextra" } struct T { // If the implicitly-declared default constructor for "T" is // required, an error will be issued because "i" cannot be // initialized. And, this class is not an aggregate, so it cannot // be brace-initialized. Thus, there is no way to create an object // of this clas...
google
chromium
ctor-dtor-privacy-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/ctor-dtor-privacy-1.C
180
utf_8
d5fcd483303360915cb089b93fa1cd74
// { dg-options "-Wctor-dtor-privacy" } struct C { // { dg-warning "" } static bool result; private: static bool check(); }; bool C::result = check();
google
chromium
Wvla-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wvla-2.C
171
utf_8
5efc219075389443353d3000bb084e7f
/* { dg-do compile } */ /* { dg-options "-pedantic-errors -Wvla" } */ void func (int i) { int array[i]; /* { dg-error "ISO C.* forbids variable.* array 'array'" } */ }
google
chromium
return-reference2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/return-reference2.C
208
utf_8
4c118508219f3e8fd47de507e2333e9c
// PR c++/26671 class A { public: int first; int second; }; int &f() { A a; // { dg-warning "local" } return a.second; } int &g() { int ar[42]; // { dg-warning "local" } return ar[20]; }
google
chromium
Wunused-parm-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-parm-4.C
223
utf_8
f11e1a6a7c64d32c0698605c42c159c1
// PR c++/47783 // { dg-do compile } // { dg-options "-Wunused -W" } struct R { int &i; }; void foo (R r, int &s) { r.i = 7; s = 8; } int bar () { int x = 1, y = 1; R r = { x }; foo (r, y); return x + y; }
google
chromium
overflow-warn-5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/overflow-warn-5.C
420
utf_8
4a9f855779aa7cb0488ab564acde90fc
/* PR c/27273 */ /* { dg-do compile } */ // This used to warn about "overflow in implicit constant conversion", // which was wrong; 512 is never converted to unsigned char. Rather, an // appropriate warning would be that the & expression always evaluates to 0 // because of the limited range of unsigned char. unsigne...
google
chromium
string1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/string1.C
257
utf_8
8f037cf9c57a56b596c880e43bb0df05
// PR c++/35652 // { dg-options "-O" } #include <string> int test() { // blank line padding, could also be code... // // // // // // // // // std::string s = ""; s += 'x' + "y"; // { dg-warning "bounds of constant string" } }
google
chromium
miss-format-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/miss-format-2.C
465
utf_8
16abc69e85d22f8f70a63462a1b1b3a7
/* Test for warnings for missing format attributes. Don't warn if no /* { dg-do compile } */ /* { dg-options "-Wmissing-format-attribute" } */ #include <stdio.h> #include <stdarg.h> void foo (int i, ...) { va_list ap; va_start (ap, i); vprintf ("Foo %s bar %s", ap); /* { dg-bogus "candidate" "bogus printf attrib...
google
chromium
Wreturn-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-3.C
234
utf_8
d0e225992bc2f0e5e2e51d846e21a8b4
// { dg-options "-Wreturn-type" } // PR c++/20624 struct fpos { fpos(int __pos) {} }; struct g { g(); ~g(); }; fpos seekoff(int b, int c) { g __buf; if (b != -1 && c >= 0) return fpos(-1); else return fpos(-1); }
google
chromium
Wconversion-pr34389
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C
1,074
utf_8
2c4607ce27b629a3ea583bebe9da3a48
/* PR 34389 */ /* { dg-do compile } */ /* { dg-options "-Wconversion -Wsign-conversion" } */ /* { dg-require-effective-target int32plus } */ short mask1(short x) { short y = 0x7fff; return x & y; /* { dg-bogus "conversion" "bogus warning" } */ } short mask2(short ssx) { short ssy; short ssz; ssz = ((int)s...
google
chromium
conversion-function-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/conversion-function-1.C
183
utf_8
a13aaa30037789e1fbc1e83bdcbaff93
// { dg-options "-Wno-conversion" } struct A { operator A&(); };
google
chromium
Wreturn-type-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-type-4.C
1,146
utf_8
c67eecc224709de2dbabbe0dfa18cef4
/* PR c++/18313 */ /* { dg-do compile } */ /* { dg-options "-Wignored-qualifiers" } */ volatile void bar(); /* { dg-warning "type qualifiers ignored" } */ struct A { const int bla(); /* { dg-warning "type qualifiers ignored" } */ static const A getA(); /* { dg-bogus "type qualifiers" } */ }; template<typenam...
google
chromium
sentinel
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/sentinel.C
348
utf_8
5e583edd642b46c07735de366c4d0f59
/* { dg-do compile } */ /* { dg-options "-Wall" } */ extern void ex (int i, ...) __attribute__ ((__sentinel__(0))); void f() { ex (1, 0); /* { dg-warning "missing sentinel in function call" "" } */ ex (1, 0L); /* { dg-warning "missing sentinel in function call" "" } */ ex (1, (void *)0); ex (1, __null); /* {...
google
chromium
Wunused-17
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-17.C
389
utf_8
40d9f628c1c36f04e81c2707bb2dd44f
// PR c++/41109, 41110, 41134 // { dg-options "-Wunused" } int memory_consumption(const int &t) { return sizeof(t); } int s; int g() { return memory_consumption(s); } template <int> struct X { static const int s = 2; }; template <typename T> int f() { const unsigned int dim = 2; return X<dim>::s; } template in...
google
chromium
Wparentheses-12
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-12.C
812
utf_8
c35ecaecfd511c9ca7d99d1d0c295518
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ version of gcc.dg/Wparentheses-9.c int foo (int); int a, b, c; int bar (void) { if (a) foo (0); if (b) foo (1); else foo (2); foo (8); else foo (9); else foo (10); if (a) if (b) foo (15); else foo (16); e...
google
chromium
main-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/main-2.C
295
utf_8
c10ffa59cbc975e37cf002ed2e59ae32
// { dg-do compile } // Make sure that the type of f1 does not change // after the error of main about not returning // int. // PR c++/23229 void f1(); void main() /* { dg-error "must return" } */ { f1(); } void f1() { }
google
chromium
weak1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/weak1.C
695
utf_8
8f3d4850eacada6c8485601a214e53bf
// { dg-do run } // { dg-require-weak "" } // The PA HP-UX and Tru64 UNIX dynamic loaders don't support unsatisfied // weak symbols. // { dg-skip-if "No unsat" { alpha*-dec-osf* hppa*-*-hpux* } { "*" } { "" } } // The darwin loader does, but they do need to exist at link time. // { dg-skip-if "No link unsat" { *-*-darw...
google
chromium
pr34985
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr34985.C
275
utf_8
78c676c6637b4d7cf784aaf33aaa6b18
/* PR34985: Warning "defined but not used" despite __attribute__((__used__)) */ /* { dg-do compile } */ /* { dg-options "-Wall -Wextra -O2" } */ static void xxyyzz (void); static void __attribute__((__used__)) xxyyzz(void) { } /* { dg-final { scan-assembler "xxyyzz" } } */
google
chromium
Wvla-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wvla-1.C
153
utf_8
88cbfbefd99299b6c8b18623d110b670
/* { dg-do compile } */ /* { dg-options "-Wvla" } */ void func (int i) { int array[i]; /* { dg-warning "variable length array 'array' is used" } */ }
google
chromium
Wnull-conversion-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C
476
utf_8
fcec658daff57c7cc81ee99de36dff99
// { dg-do compile } // { dg-options "-Wconversion-null" } #include <stddef.h> void func1(int* ptr); void func2() { int* t = false; // { dg-warning "converting 'false' to pointer" } int* p; p = false; // { dg-warning "converting 'false' to pointer" } int* r = sizeof(char) / 2; ...
google
chromium
Wparentheses-6
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-6.C
2,202
utf_8
707ccbf6767343299198f33f687b6ec0
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ version of gcc.dg/Wparentheses-2.c. int foo (int); int bar (int a, int b, int c) { foo (a <= b <= c); // { dg-warning "comparison" "correct warning" } foo ((a <= b) <= c); foo (a <= (b <= c)); foo (1 <= 2 <= c); // { dg-warning "comparison" "corre...
google
chromium
Wsign-compare-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wsign-compare-3.C
219
utf_8
65dcbd82ed4800506ba5d69b0d7b8ecc
// { dg-do compile } // { dg-options "-Wsign-compare" } enum E { A, B, C }; extern void f1(int); void f2(E v1, E v2) { for (unsigned int i = v1; i <= v2; ++i) f1(i); for (int i = v1; i <= v2; ++i) f1(i); }
google
chromium
Walways-true-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Walways-true-2.C
1,274
utf_8
663359b0839155d74214e17713f6b355
// Make sure we don't assume that a weak symbol is always non-NULL. // This is just like Walways-true-1.C, except that it uses a weak // symbol. // { dg-do compile } // { dg-options "-Waddress" } // { dg-require-weak "" } extern int foo (int) __attribute__ ((weak)); int i __attribute__ ((weak)); void bar (int a) { lab...
google
chromium
Wunused-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-3.C
158
utf_8
19f1d5b223a75e9107f8207c10aa080c
// { dg-do compile } // { dg-options "-Wunused -O" } void do_cleanups(); class Cleanup { public: ~Cleanup() { do_cleanups();} }; static Cleanup dummy;
google
chromium
inline1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/inline1.C
548
utf_8
0c33b46fd2f31938e2ff6fb7fc3f0b90
// { dg-do compile } // PR 4803. Used inline functions must have a definition. inline void Foo1 (); // { dg-warning "inline function" "" } inline void Bar1 (); template <typename T> inline void Foo2(T); // { dg-warning "inline function" "" } template <typename T> inline void Bar2(T); void Baz () { Foo1 (); Foo2 ...
google
chromium
Wparentheses-10
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-10.C
4,181
utf_8
8c1be4fe2c44958f9fdf70a20cd94fbe
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ version of gcc.dg/Wparentheses-7.c int foo (int); int bar (int a, int b, int c) { foo (a & b ^ c); // { dg-warning "parentheses" "correct warning" } foo ((a & b) ^ c); foo (a & (b ^ c)); foo (1 & 2 ^ c); // { dg-warning "parentheses" "correct warn...
google
chromium
inline2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/inline2.C
245
utf_8
7c84293b9be13f3fdd30d3803765a5c4
// PR c++/21627 template<typename T> struct TPL { TPL (){} ~TPL (){} void method () {} }; template <> TPL<int>::TPL (); template <> TPL<int>::~TPL (); template <> void TPL<int>::method (); void Foo () { TPL<int> i; i.method (); }
google
chromium
Wuninitialized-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wuninitialized-1.C
246
utf_8
fe4c6303d7ec13423e71cfb150c05d00
/* { dg-options "-O2 -Wuninitialized" } */ struct Empty { Empty() {} }; /* { dg-bogus "uninitialized" } */ struct Other { Other(const Empty& e_) : e(e_) {} Empty e; }; void bar(Other&); void foo() { Empty e; Other o(e); bar(o); }
google
chromium
conv1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/conv1.C
477
utf_8
85be959a24d4346758266af7cda69d72
// { dg-do compile } // PR 10337, unneeded warning class A { public: A() {} }; class B : public A { public: B() {} void operator=(const A& b) {} void operator=(const B& b) {} }; class C { public: C() {} operator B &() { return _b; } operator const B &() const { return _b; } B _b; }; int main() ...
google
chromium
Woverflow-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Woverflow-3.C
111
utf_8
c8cfeb1be8b9ab6b1a5bf044e67e73e2
/* { dg-do compile } */ /* { dg-options "-O2 -Wno-overflow" } */ #include <limits.h> int foo = INT_MAX + 1;
google
chromium
pr13358
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr13358.C
635
utf_8
061efc30af7992ab1388f47b212ad1fc
// PR c++/13358: g++ should accept a long long constant sans LL suffix // if -Wno-long-long is in use. // { dg-do compile } // { dg-require-effective-target int32plus } // { dg-options "-std=c++98 -Wno-long-long -pedantic-errors" } void use_longlong () { unsigned long long x1, x2, x3; // make sure it's ok with ...
google
chromium
Wstring-literal-comparison-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wstring-literal-comparison-2.C
370
utf_8
c608f5d02a06d2e24d8ab0ca0d977f67
/* PR c/7776 */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ int test1(char *ptr) { return ptr == "foo"; /* { dg-warning "comparison with string" } */ } int test2() { return "foo" != (const char*)0; } int test3() { return "foo" == (const char*)0; } int test4() { return (const char*)0 != "foo"; } i...
google
chromium
Wvla-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wvla-3.C
112
utf_8
43ab54c8c4c6f2ba5ea4192d282a669e
/* { dg-do compile } */ /* { dg-options "-pedantic-errors -Wno-vla" } */ void func (int i) { int array[i]; }
google
chromium
sequence-pt-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/sequence-pt-2.C
1,503
utf_8
51453c25b899451d48a5947b60d782cf
/* More sequence point warning tests */ /* { dg-do compile } */ /* { dg-options "-Wsequence-point" } */ struct s { struct s *nxt; int v; } q; int x[10]; int foo(int *p) { int i = 0; /* Test general-lvalue sequence point warnings */ (*p) = (*p)++; /* { dg-warning "undefined" "sequence point warning" ...
google
chromium
Wuninitialized-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wuninitialized-3.C
246
utf_8
ff7e55750a566580a7e5b746cf7dfa22
// PR C++/38908 // { dg-options "-Wuninitialized -O" } struct empty {}; struct dfs_visitor { dfs_visitor() { } empty m_vis; }; void bar(const dfs_visitor&); void foo(void) { dfs_visitor vis; dfs_visitor vis2 = vis; bar (vis2); }
google
chromium
deprecated-5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/deprecated-5.C
123
utf_8
9fb0087e50484de53d979d8e849be2eb
// PR c++/16370 struct Foo { int i; } __attribute__ ((deprecated)); void foo() { Foo f; } // { dg-warning "deprecated" }
google
chromium
multiple-overflow-warn-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-1.C
357
utf_8
1843c11c874c72ec8512fdb7ee86990e
/* PR c/19978 : Test for duplicated warnings (unary operators). */ /* { dg-do compile } */ /* { dg-options "-Woverflow" } */ #include <limits.h> int g (void) { return - - - - -INT_MIN; /* { dg-bogus "integer overflow in expression.*integer overflow in expression" } */ /* { dg-warning "integer overflow in expres...
google
chromium
Wunused-parm-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-parm-1.C
697
utf_8
f4f3cab40f639491cc5a09f1d424f9ce
// { dg-do compile } // { dg-options "-Wunused -W" } long f1 (unsigned long long x) { unsigned long long a = 1; const union { unsigned long long l; unsigned int p[2]; } b = { x }; const union { unsigned long long l; unsigned int p[2]; } c = { a }; return b.p[0] + c.p[0]; } int f2 (int x, int y) { int a = 1;...
google
chromium
Woverflow-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Woverflow-1.C
138
utf_8
7256cd2e505f10c051c8ac833ca88513
/* { dg-do compile } */ /* { dg-options "-O2" } */ #include <limits.h> int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */
google
chromium
pedantic2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pedantic2.C
167
utf_8
4c8c625ae79211ff8d60b894c8b21b81
// { dg-options "-pedantic" } class foo { foo() {}; void bar() {}; foo(int) {};; // { dg-warning "extra" } void bar(int) {};; // { dg-warning "extra" } };
google
chromium
Wshadow-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wshadow-3.C
110
utf_8
c6d10f027652eb4c20869c7eaeebb358
// PR c++/18530 // { dg-options "-Wshadow" } struct A { A(); ~A(); void foo (int __ct, int __dt) {} };
google
chromium
Wparentheses-17
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-17.C
933
utf_8
91ab8d0010665a4d81358361c95189a1
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-8.C. int foo (int); template<class T> void bar (T a, T b, T c) { foo (a && b || c); // { dg-warning "parentheses" "correct warning" } foo ((a && b) || c); foo (a && (b || c)); foo (1 && 2 || c); // { dg-warning "parent...
google
chromium
pr28943
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr28943.C
498
utf_8
a7158d5a1d0acfa018bf80fecfe8aa6e
// PR c++/28943 void and non-void in conditional expression // { dg-do compile } // { dg-options "" } void debug (const char * string) { return; } int f() { ( true == false ? 0 : debug ("Some string")); // { dg-error "third operand .* type 'void'.* second operand is neither a throw-expression nor of type 'void'" ...
google
chromium
pr16302
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr16302.C
4,584
utf_8
41d9cea464884b07741794bae6f22f9f
// PR 16302 /* { dg-do compile } */ /* { dg-options "-Wlogical-op" } */ void bar (int); int foo (int argc, char *argv[]) { if (argc != 1 || argc != 2) return 1; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */ if (argc < 0 && argc > 10) return 1; /* { dg-warning "'and' of mutually exclusi...
google
chromium
Warray-bounds-5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Warray-bounds-5.C
352
utf_8
843811e9e3bbecf56a84c608e9fd1073
// { dg-do compile } // { dg-options "-O2 -Warray-bounds" } void f(); int c[3]; int result; struct Vector { static int get(int i) { if (i >= 3) f(); return c[i]; } }; void g() { for (int i = 0; i < 3; ++i) { const int index = i % 3; result = Vector::get(index)...
google
chromium
Warray-bounds-3
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Warray-bounds-3.C
225
utf_8
de22eb15ae2420b77fbb90f3b584c785
/* { dg-do compile } */ /* { dg-options "-O2 -Wall" } */ extern void function(void * x); struct A { long x; char d[0]; }; void test(A * a) { function((char *)a - 4); /* { dg-bogus "below array bounds" } */ }
google
chromium
Wunused-var-15
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-var-15.C
312
utf_8
9dc537daf68b0277551461969cabca13
// PR c++/45588 // { dg-do compile } // { dg-options "-Wunused" } void bar (unsigned char *); template <int N> struct S { static const int k = 6; }; template <int N> const int S<N>::k; template <int N> void foo () { const int i = S<N>::k; unsigned char a[i]; bar (a); } void baz () { foo<0> (); }
google
chromium
miss-format-4
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/miss-format-4.C
902
utf_8
ed4e1a2fb0bdeb0c706fbaea8bc05dfa
/* { dg-do compile } */ /* { dg-options "-Wmissing-format-attribute" } */ /* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */ #include <stdarg.h> typedef void (*noattr_t) (const char *, ...); typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t; typedef void (*vnoattr_t) (co...
google
chromium
pr11492
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pr11492.C
259
utf_8
f257fca4d00c8c67aa2b9d6e43ee906f
// PR11492 // { dg-do compile } // { dg-options "-Wsign-compare" } int main( void ) { unsigned int a; unsigned char b; for ( a = 0, b = 2; a > b * 1000; a++ ) /* { dg-bogus "comparison between signed and unsigned integer" } */ { ; } return 0; }
google
chromium
pragma-system_header5
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/pragma-system_header5.C
137
utf_8
ead08695035c4edabe2cbf3251983089
// PR c++/36760 // { dg-options "-Wextra" } #include "pragma-system_header5.h" void f() { g<const double>(); g<volatile void>(); }
google
chromium
anonymous-namespace-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/anonymous-namespace-2.C
516
utf_8
f8ad5a1b952230262de883716c47bcdd
// Test for the warning of exposing types from an anonymous namespace // { dg-do compile } // #include "anonymous-namespace-2.h" namespace { struct good { }; } struct g1 { good * A; }; struct g2 { good * A[1]; }; struct g3 { good (*A)[1]; }; #line 21 "foo.C" struct b1 { // { dg-warning "uses the anon...
google
chromium
sequence-pt-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/sequence-pt-1.C
5,891
utf_8
b4951d18f427e3e3b23044a0d01134c5
/* Test for sequence point warnings. */ /* Origin: Michael Meeks in <URL:http://gcc.gnu.org/ml/gcc-patches/1998-06/msg00316.html>, /* { dg-do compile } */ /* { dg-options "-Wsequence-point" } */ struct s { int a; }; extern int fn (int); extern int fnb (int, int); extern int fnc (int *); extern int sprintf (char *...
google
chromium
Wsequence-point-1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wsequence-point-1.C
140
utf_8
78a781a7fee9227b3174b6dee0ac20b3
// { dg-do compile } // { dg-options "-Wsequence-point" } struct C { ~C() throw(); }; void t_test1 (C* mapping) { delete [] mapping; }
google
chromium
Wreturn-type-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-type-2.C
192
utf_8
1d81b4c94aef9d2c63d5599d4508e03a
// PR middle-end/16558 // { dg-options "-Wreturn-type" } struct C { C (); ~C (); }; int getref (int ndx) { C d; if (ndx != 0) { C base; return 0; } else return 0; }
google
chromium
main
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/main.C
180
utf_8
217f0311161c670d6ef0fbd06a3c6b91
// { dg-do compile } // PR c++/4494: Incorrect diagnostics about return type of main. typedef int int_t; int_t main() { }
google
chromium
Warray-bounds-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Warray-bounds-2.C
221
utf_8
798433d4099cd8d7572fde802e640896
/* { dg-do compile } */ /* Test that -Warray-bounds is enabled by -Wall */ /* { dg-options "-O2 -Wall" } */ int a[10]; int* f(void) { a[-1] = 0; /* { dg-warning "array subscript" } */ return a; }
google
chromium
Wno-div-by-zero
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wno-div-by-zero.C
91
utf_8
13048d07bf8630f21562df0b77b67343
// { dg-options "-Wno-div-by-zero" } int breakme() { int x = 0; x /= 0; return x; }
google
chromium
Wswitch-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wswitch-2.C
754
utf_8
063811cae4064dfe33ddbcd11e9f93ee
/* Further -Wswitch tests. */ /* { dg-do compile } */ /* { dg-options "-Wswitch" } */ enum e { e1 = 0, e2 = 1, e3 = 1, e4 = 2 }; int foo (enum e ei, int j) { switch (ei) { case e1: return 1; case e3: return 2; case e4: return 3; } /* No warning here since e2 has the same value as e3. */ swit...
google
chromium
Wstrict-aliasing-2
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-2.C
215
utf_8
414da1b51217d31e1c2f4c076e8fe650
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ double x; template <typename T> T *foo(void) { return (T *)&x; /* { dg-bogus "strict-aliasing" } */ } template double *foo<double>(void);
google
chromium
Wall-write-strings
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/Wall-write-strings.C
138
utf_8
38c1d3bcd70aac8e2e1f0e19b075e6a9
// PR 8586 // { dg-do compile } // { dg-options "-Wall" } char* foo = "foo"; // { dg-warning "" } const char* bar = "bar";
google
chromium
switch1
.C
native_client/pnacl-gcc/gcc/testsuite/g++.dg/warn/switch1.C
313
utf_8
cbeb61a079567f59bdce9faa40877398
// { dg-do compile { target { int32plus } } } signed char sc; void foo (void) { switch (sc) { case 1: case 2 * __SCHAR_MAX__ + 3: // { dg-warning "case label value exceeds maximum" } case - 2 * __SCHAR_MAX__ - 1: // { dg-warning "case label value is less than minimum" } break; } }