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
android
Wuninitialized-5
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-5.C
316
utf_8
2e05be0ce305723a94a4113e02835003
// { dg-do compile } // { dg-options -Wparentheses } // C++ version of gcc.dg/Wparentheses-1.c. int foo (int a, int b) { int c = (a && b) || 0; // { dg-bogus "suggest parentheses" } c = a && b || 0; // { dg-warning "suggest parentheses" } return (a && b && 1) || 0; // { dg-bogus "suggest parentheses" } }
google
android
Wunused-var-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-2.C
793
utf_8
6f250a1bec102f3ef4c4450109985c6c
// { dg-options "-Wunused -W" } extern void foo (); void f1 () { try { foo (); } catch (int i) { } catch (double d) { } } void f2 (int x) { int a = 0; x++; ++a; } struct A { bool foo () const { return true; } }; int f3 () { A a; bool b = a.foo (); return b; } stru...
google
android
pointer-integer-comparison
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pointer-integer-comparison.C
790
utf_8
f8f2c98db3d6299492ead2d45e4b5e37
// { dg-do compile } // { dg-options "-fsyntax-only -fpermissive" } int foo (int i, void *p) { if (i == p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 0; else if (i != p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" } return 1; } int bar (...
google
android
Wunused-var-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-4.C
742
utf_8
62e5565091b4ee3f018515196f818bf3
/* { dg-do compile } */ /* { dg-options "-Wunused" } */ struct S { int e; }; int f1 (void) { int a; int b; int c; int d; S s; a = 1; b = 2; c = 3; d = 4; s.e = 5; __decltype (d) f; // { dg-warning "set but not used" } __decltype (s.e) g; // { dg-warning "set but not used" } e = 1; f = 1; g...
google
android
Wreturn-type-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-type-3.C
142
utf_8
0877959d4ff69bc477955ce1ceadb231
// PR middle-end/19583 // { dg-options "-Wreturn-type -O" } struct E{}; inline int bar() throw(E) { return 0; } void foo () { bar(); }
google
android
Woverflow-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Woverflow-4.C
226
utf_8
3fb9d4575f0f00803eef196d3233d454
// PR c++/51151 // { dg-options "-Wshadow" } template<typename T> class C { public: void f() { m = c2 + 1; } static const long unsigned int c1 = 7; static const int c2 = c1 - 1; int m; }; template class C<int>;
google
android
Wstrict-aliasing-bogus-escape-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-escape-2.C
221
utf_8
7d718e1471f9c88db63a362d36027ca2
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing" } */ #include<list> struct A { virtual ~A(); }; A* foo(); void bar(std::list<int> x) { std::list<int> y = x; if (*y.rbegin()) delete foo(); }
google
android
pr36954
.C
toolchain/gcc/gcc-4.9/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
android
Warray-bounds-6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
394
utf_8
d53003b93dc25906e11f3f1291fb8a1d
// { dg-do compile } // { dg-options "-O3 -Warray-bounds" } struct type { bool a, b; bool get_b() { return b; } }; type stuff[9u]; void bar(); void foo() { for(unsigned i = 0u; i < 9u; i++) { if(!stuff[i].a) continue; bar(); for(unsigned j = i + 1u; j < 9u; j++) if(stuff[j].a && ...
google
android
pedantic2
.C
toolchain/gcc/gcc-4.9/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
android
Wstrict-aliasing-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-4.C
252
utf_8
018ddc3284f5451940a479a4b278702c
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ double x; template <typename T> T *foo(void) { int a[2]; float *y = (float *)a; /* { dg-bogus "strict-aliasing" } */ return (T *)&x; /* { dg-bogus "strict-aliasing" } */ }
google
android
Wshadow-7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-7.C
1,168
utf_8
de70d0aa4d300c6c495ac17ceb16bb59
// PR c++/44128 // { dg-options "-Wshadow" } typedef long My_ssize_t; // { dg-message "shadowed declaration" } typedef int Foo; // { dg-message "shadowed declaration" } struct Bar1 { // { dg-bogus "shadowed declaration" } int a; }; struct Bar2 { // { dg-message "shadowed declaration...
google
android
forward-inner
.C
toolchain/gcc/gcc-4.9/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
android
noeffect6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/noeffect6.C
239
utf_8
58c48dbaffba495d57fb0bf370f50060
// { dg-options "-Wall" } // PR c++/15083 extern "C" int printf(const char*,...); struct Counter { Counter(){printf("Hello World.\n");} }; template< typename T > void resetData() { new Counter(); } int main() { resetData<int>(); }
google
android
deprecated-5
.C
toolchain/gcc/gcc-4.9/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
android
Wshadow-local-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-2.C
1,584
utf_8
4c4329c54c19567a9ed550736b5af872
/* { dg-do compile } */ /* { dg-options -Wshadow-local } */ class Bar { }; class ChildBar : public Bar { }; Bar bar; // { dg-bogus "shadowed declaration" } class Foo { private: int val; public: int func1(int x) { int val; // { dg-bogus "shadows a member" } val = x; return val;...
google
android
return-reference2
.C
toolchain/gcc/gcc-4.9/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
android
Wchar-subscripts
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-15
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-15.C
2,283
utf_8
08a0dd4d42f7674207742306f422308a
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-6.C. int foo (int); template<class T> void bar (T a, T b, T c) { foo (a <= b <= c); // { dg-warning "comparison" "correct warning" } foo ((a <= b) <= c); foo (a <= (b <= c)); foo (1 <= 2 <= c); // { dg-warning "compari...
google
android
Wunused-6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-6.C
205
utf_8
716f99b28cebbf385c168497daeff7ae
/* PR middle-end/14203 */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ void foo() { if (false) if (int i=0) // { dg-warning "unused" "" } int j=0; // { dg-warning "unused" "" } }
google
android
sequence-pt-1
.C
toolchain/gcc/gcc-4.9/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
android
Wfloat-equal-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wfloat-equal-1.C
430
utf_8
5eb7ea7761d111befc6050ff4baa1559
/* PR c/19999 */ /* { dg-do compile } */ /* { dg-options "-Wfloat-equal" } */ double a, b; _Complex double c, d; int f(void) { return a == b; } /* { dg-warning "comparing floating point" } */ int g(void) { return c == d; } /* { dg-warning "comparing floating point" } */ int h(void) { return a != b; } /* { dg-warning "...
google
android
anonymous-namespace-2
.C
toolchain/gcc/gcc-4.9/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
android
Wstring-literal-comparison-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstring-literal-comparison-1.C
374
utf_8
b2ac295c001e28b6659dd1cbaecfc2a9
/* PR c/7776 */ /* { dg-do compile } */ /* { dg-options "-Waddress" } */ 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"; ...
google
android
Wuninitialized-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wuninitialized-2.C
1,134
utf_8
21fc5ac0f1ee255b648d071723254d87
/* { dg-do compile } */ /* { dg-options "-O -Wuninitialized" } */ struct S8 { template<typename T> S8(T) { } }; template<typename T> struct S10; template<typename T> struct S10<T()> { typedef T S12; typedef S8 S1(); }; template<typename T> struct S3 { }; template<typename T> struct S11 { S11(S3<T>); }; struct S2 { ...
google
android
Wstrict-aliasing-float-ref-int-obj
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C
398
utf_8
d408482031edcca951354bc89ba9ec8e
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ int foo() { int x; float& q = reinterpret_cast<float&> (x); /* { dg-message "dereferencing type-punned" "deref" { target *-*-* } } */ q = 1.0; /* { dg-warning "does break strict-aliasing" "strict-aliasing" { xfail *-*-* } } ...
google
android
Wsequence-point-1
.C
toolchain/gcc/gcc-4.9/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
android
var-args1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/var-args1.C
167
utf_8
7a505253e3b2855a427b6a0f5ddda38d
/* { dg-do compile } */ #include <stdarg.h> void foo(int, ...) { va_list va; int i; i = va_arg(va, int&); /* { dg-error "cannot receive objects" } */ }
google
android
pr15774-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr15774-2.C
240
utf_8
8ac81ba3ba031fdbb5e74a57d7844304
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } // Test that old declaration is used, if new one has no attributes. extern void __attribute__((stdcall)) foo (int); void bar (void) { foo (1); } void foo (int i) { }
google
android
Wunused-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-1.C
288
utf_8
d08f8f4d2f55349741193b20c16afa1a
// Test whether -Wunused handles empty classes the same as non-empty. // { dg-do compile } // { dg-options "-Wunused" } struct A {}; struct B { char c; }; void foo () { struct A a0, a1; struct B b0, b1 = { 25 }; a0 = a1; // { dg-bogus "value computed is not used" } b0 = b1; }
google
android
pr30551-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr30551-2.C
378
utf_8
7100f239e09f21f83f0e1c49776bacf7
// PR 30551 -Wmain is enabled by -pedantic/-pedantic-errors. // { dg-do compile } // { dg-options "-pedantic-errors" } // { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } int main(char a) {} /* { dg-error "first argument of .*main.* should be .int." "int" } */ /* { dg-error "main.* takes only zero...
google
android
Wparentheses-21
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-21.C
1,057
utf_8
f5f50acbe2a146e13079538cc1b650f3
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-12.C. Note that we currently warn // when we initially parse the template, not when we are instantiating // it. That seems reasonable since the template parameters can not // affect the syntax parsing. int foo (int); int a, b, ...
google
android
pedantic1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pedantic1.C
184
utf_8
a17c4c0444990921d3c66161e1a84c51
// PR10032 // { dg-options "-pedantic" } int main() { goto label; // { dg-error "" } int temp = 1; // { dg-error "" } label: // { dg-error "" } return 1; }
google
android
Wreturn-local-addr-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-local-addr-2.C
292
utf_8
47e19e0aa7cc935c5692f22838d704d8
// PR c++/44859 struct Base2 { int m_foo; }; struct Derived2 : public Base2 {}; const Base2& f8() { return Derived2(); } // { dg-warning "reference to temporary" } struct foo { }; struct bar { foo base; }; const foo& f9() { return bar().base; } // { dg-warning "reference to temporary" }
google
android
overflow-warn-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
4,871
utf_8
cc7188e3168c426884a67c341f5fb2ba
/* { dg-do compile } */ /* { dg-options "-pedantic-errors" } */ #include <limits.h> enum e { E0 = INT_MAX, /* Unsigned overflow wraps around. */ E1 = UINT_MAX + 1, /* Overflow in an unevaluated part of an expression is OK (example in the standard). */ E2 = 2 || 1 / 0, /* { dg-bogus "warning: division b...
google
android
wdate-time
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/wdate-time.C
337
utf_8
4047fbaa76a1a5d41ea12f6f27df3243
/* { dg-do compile } */ /* { dg-options "-Wdate-time" } */ const char time[] = __TIME__; /* { dg-warning "might prevent reproducible builds" } */ const char date[] = __DATE__; /* { dg-warning "might prevent reproducible builds" } */ const char timestamp[] = __TIMESTAMP__; /* { dg-warning "might prevent reproducib...
google
android
pragma-system_header3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pragma-system_header3.C
110
utf_8
731cdbbff9a041d6f86a91b8596ae256
// PR c++/32368 // { dg-options "-Wall -O" } #include "pragma-system_header3.h" int main() { return f(); }
google
android
Wtype-limits-Wextra
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wtype-limits-Wextra.C
3,254
utf_8
4bb5e5e5968b1a943e877d661fd1a979
/* 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
android
inline1
.C
toolchain/gcc/gcc-4.9/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
android
Wnull-conversion-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C
960
utf_8
b8f3f38dd8d5d8ef31e0bb0e16dd76e2
// { dg-do compile } // { dg-options "-Wconversion-null" } #include <stddef.h> class Foo { public: template < typename T1, typename T2 > static void Compare (const T1 & expected, const T2 & actual) { } template < typename T1, typename T2 > static void Compare (const T1 & expected, T2 * actual) { ...
google
android
noeffect8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/noeffect8.C
220
utf_8
66e0590894778b4ef227905c708142a8
// PR c++/26696, 28996 // { dg-do compile } // { dg-options "-Waddress" } struct A { static void f() {} }; int main() { A a; a.f; // { dg-warning "not call" } A().f; // { dg-warning "not call" } }
google
android
Wdelete-incomplete-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wdelete-incomplete-1.C
176
utf_8
d65a98d6ba1b68ebec8c8b9ef31e4cfc
// PR c++/43452 class Foo; // { dg-warning "forward" } int main() { Foo* p; // { dg-warning "incomplete" } delete [] p; // { dg-warning "problem" } }
google
android
miss-format-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/miss-format-3.C
892
utf_8
d38eae092825c980b4c8c291c3d56273
/* { 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
android
unused-result1
.C
toolchain/gcc/gcc-4.9/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
android
miss-format-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/miss-format-5.C
1,043
utf_8
e8e1065301c5aeeb1cd383514614b891
/* { 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
android
ctor-init-1
.C
toolchain/gcc/gcc-4.9/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
android
Wself-assign-non-pod-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-5.C
839
utf_8
fe0287a1a9316bf2cc6a4dcd3616169d
// Test -Wself-assign and -Wself-assign-non-pod. // { dg-do compile } // { dg-options "-Wself-assign -Wself-assign-non-pod" } template<typename T> class Foo { private: T a_; public: Foo() : a_(a_) {} // { dg-warning "assigned to itself" } void Set() { a_ = a_; } // { dg-warning "assigned to itself" } }...
google
android
pr36999
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr36999.C
773
utf_8
b731b5d32c1f477ed23555d37dcf870a
/* PR36999: Erroneous "does not declare anything" warnings. */ /* { dg-do compile } */ class C1 { public: class C2 { }; }; void cf1 (class C1::C2, void*); // { dg-bogus "does not declare anything" } void cf2 (void*, class C1::C2); void cf3 (C1::C2, void*); namespace N { enum E1 { foo }; enum E2 { bar }; templ...
google
android
pmf1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pmf1.C
258
utf_8
acd9eb52e3298cbde90941f636efb15f
// { dg-do compile } // PR c++/10496: Incorrect pointer to member function diagnostics // for constant member functions. struct a { int f() const; }; int a::f() const { int (a::* b)() const = &f; // { dg-error "&a::f" } }
google
android
format4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/format4.C
301
utf_8
127a75cc2feba3be6bc12b766e660668
// { dg-do compile } // { dg-options "-Wformat=2" } extern "C" int printf (const char*, ...); void foo(int i) { printf("Hello World %d!\n", i); printf(&"Hello World %d!\n"[0], i); printf(&"Hello World %d!\n"[6], i); printf(&"Hello World %d!\n"[8]-2, i); printf(&"Hello World %d!\n"[4]+2, i); }
google
android
Wswitch-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wswitch-1.C
1,280
utf_8
1602bd10d4608c803844306d2ef03513
/* PR c/4475, PR c++/3780 */ /* { dg-do compile } */ /* { dg-options "-Wswitch" } */ enum e { e1, e2 }; int foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el, enum e em, enum e en, enum e eo, enum e ep) { switch (i) { case 1: return 1; case 2: return 2; } switch (j) { case...
google
android
translate-ice-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/translate-ice-1.C
971
utf_8
6f5999bf56f2861a257750422cda17b6
// Test ICE in caching printable names for a function. // { dg-options "-std=c++98 -pedantic -O2" } void g (int a) __attribute__((warning("g"))); void g2 (int a, int *p); static inline __attribute__((__always_inline__)) void gg (int a) { if (a == 0) return g(a); // { dg-warning "attribute" } __extension__ int ...
google
android
volatile1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/volatile1.C
181
utf_8
a477b1f44b6db6cb983209da8ed32c5f
// PR c++/26577 struct A { A(const A&); A& operator=(const A&); void baz() volatile; }; void A::baz() volatile { *this; // { dg-warning "indirection will not access" } }
google
android
pr15774-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr15774-1.C
318
utf_8
1759cc2449b492ee8c742ec4f8703312
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } // Test that an new declartion with different attributes then old one fail. extern void foo (int); // { dg-message "old declaration" } void bar (void) { foo (1); } void __attribute__((stdcall)) foo (int i) // { dg-error "new declaration" } { }
google
android
do-empty
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/do-empty.C
265
utf_8
9c49d36a54518ba5874b3fe7045ef791
/* Test diagnostics for empty bodies in do / while. */ /* { dg-do compile } */ /* { dg-options "-Wempty-body" } */ void f (int x) { do ; /* { dg-warning "empty body in" } */ while (x--); do {} /* { dg-bogus "empty body in" } */ while (++x < 10); }
google
android
Wcast-qual1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wcast-qual1.C
150
utf_8
3667162d7aa037ab6197e7d3ffea1a6c
// PR c++/24667 // { dg-options "-Wcast-qual" } int main(int, char**) { const int foo[2] = {1,1}; ((int*)foo)[0] = 0; // { dg-warning "cast" } }
google
android
Wparentheses-18
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-18.C
4,245
utf_8
efbe99f9deea7ce008810d1c4ae8906d
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-9.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 "parentheses" "...
google
android
Wunused-var-20
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-20.C
219
utf_8
e7274165f26fc70eff73fddbd77e3811
// PR c++/38958 // { dg-options "-Wunused" } volatile int g; struct Lock { ~Lock() { g = 0; } }; Lock AcquireLock() { return Lock(); } int main() { const Lock& lock = AcquireLock(); g = 1; g = 2; g = 3; }
google
android
Wsign-compare-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsign-compare-2.C
206
utf_8
9783f1e807119d28bffbe38aaa6b2a85
// PR c/35430 // { dg-do compile } // { dg-options "-Wsign-compare" } void foo (__complex__ int i) { i == 0u; i == ~1u; // { dg-warning "comparison between signed and unsigned integer expressions" } }
google
android
Wunused-parm-4
.C
toolchain/gcc/gcc-4.9/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
android
pr33160
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr33160.C
244
utf_8
e8794ff206600f5a49415327a54a5bf8
// PR 33160 // { dg-do compile } // { dg-options "-Wall -Wextra -Wpointer-arith -pedantic -Wconversion" } typedef int __attribute__((mode(pointer))) intptr_t; int foo(void) { intptr_t t = 0; if (t != ((intptr_t)__null)) t = 1; return 0; }
google
android
Wno-div-by-zero
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-27
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-27.C
179
utf_8
7a96365ecbfd1228be4ae36c4a937a7f
// PR c++/54194 // { dg-options "-Wparentheses" } int main() { char in[4] = { 0 }; in[1] = in[1] & 0x0F | ((in[3] & 0x3C) << 2); // { dg-warning "17:suggest parentheses" } }
google
android
noreturn-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/noreturn-3.C
276
utf_8
99162a062d0507c49cfdb62a0ec174e4
// { dg-do compile } // { dg-options "-Wall" } // PR c++/13106: No return warning when return type is a dependent type. template <typename T> T dummy() { } int main() { dummy<void>(); }
google
android
Wreturn-type-7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-type-7.C
247
utf_8
7d2696250f449ef817e376057902360c
// PR c++/20681 // { dg-options -Wreturn-type } struct a{~a();a();}; int GetMetaCombination (int a2) { a bi; switch (a2) { case 1: return 18; break;//removing this works around the warning default: return 0; } }
google
android
anonymous-namespace-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/anonymous-namespace-4.C
152
utf_8
d932d5a80777e6eb1f5c5b5ddab9d03d
// PR c++/57137 #include "anonymous-namespace-4.h" namespace { class NonCloneable; void fn1 () { is_function_impl < NonCloneable > i; } }
google
android
Wunused-7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-7.C
200
utf_8
084d01a6fec132cfc8842f26f8cc6917
// PR c++/14481 // { dg-options "-Wunused" } void func() { struct mybitfields { unsigned int s_field:8; }; struct mybitfields s; // { dg-warning "set but not used" } s.s_field = 255; };
google
android
switch1
.C
toolchain/gcc/gcc-4.9/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; } }
google
android
incomplete1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/incomplete1.C
680
utf_8
be404e3ceddfa2f8ed7c5fe4e170ae7c
// { dg-do compile } // Contributed by Brian Gaeke; public domain. // 5 If the object being deleted has incomplete class type at the // point of deletion and the complete class has a non-trivial // destructor or a deallocation function, the behavior is undefined. // (But the deletion does not constitute an ill-forme...
google
android
Warray-bounds-2
.C
toolchain/gcc/gcc-4.9/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
android
Wsign-compare-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsign-compare-1.C
100
utf_8
2247cfbc59da044c90471731c49fe14d
// { dg-options "-Wsign-compare" } extern unsigned u; template<class F> int f() { return u > 1; }
google
android
register-var-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/register-var-2.C
274
utf_8
ea73d6265dc16c3e8af8fcf468fbfdee
/* PR/18160 */ /* { dg-do compile } */ /* This should yield an error even without -pedantic. */ /* { dg-options "-Wall -W" } */ void g(int *); void f(void) { register int x; g(&x); /* { dg-warning "address requested for 'x', which is declared 'register'" } */ }
google
android
Wunused-label-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-label-1.C
574
utf_8
4b4d62ec49110404478b690512efb2fd
// { dg-do compile } // { dg-options "-Wunused-label" } extern void f9(); void f1() { l1: f9(); // { dg-warning "not used" } l3: ; f9(); // { dg-warning "not used" } l4: __attribute__ ((unused)) ; f9(); } void f2() { label: __attribute ((unused)) ; } void f3() { // The next line would be OK in C but is ...
google
android
Wsign-compare-3
.C
toolchain/gcc/gcc-4.9/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
android
Wshadow-2
.C
toolchain/gcc/gcc-4.9/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
android
miss-format-2
.C
toolchain/gcc/gcc-4.9/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
android
Warray-bounds
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Warray-bounds.C
2,461
utf_8
b1f89524960615092626095cd38d9d33
/* { dg-do compile } */ /* { dg-options "-O2 -Warray-bounds" } */ int a[10]; extern "C" __SIZE_TYPE__ strlen(const char *s); static inline int n(void) { return strlen("12345"); } void g(int *p); void h(int p); int* f(void) { int b[10]; int i; struct { int c[10]; } c; a[-1] = 0; ...
google
android
Wunused-17
.C
toolchain/gcc/gcc-4.9/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
android
conv3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/conv3.C
66
utf_8
cc281c397d45da8c573eee459fc65fa7
// PR c++/19457 int i=-1; unsigned int j= ~0; // { dg-bogus "" }
google
android
Wstrict-aliasing-bogus-base-derived
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C
286
utf_8
36c50018c4d8d64200e0e3bc6b163e6d
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ class base { public: int x; }; class derived: public base { public: int y; }; base foo () { derived d; base* pb = &d; /* { dg-bogus "base vs. derived" } */ pb->x = 1; return d; }
google
android
Wshadow-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-1.C
1,059
utf_8
44fe19ff71727efce22e2f732d2ac553
/* { dg-do compile } */ /* { dg-options -Wshadow } */ /* Source: Neil Booth, 3 Nov 2001, and PR 16, 713. -Wshadow was giving a bunch of warnings we didn't want, and wasn't giving the location of the shadowed variable. */ struct status // { dg-bogus "shadowed declaration" } { int member; void foo2 (); in...
google
android
Wunused-12
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-12.C
132
utf_8
ed6fbf0a414b22ad6579cf9a3fbe6c2f
// PR c++/24302 // { dg-options "-Wunused" } static union { unsigned char FLT4ARR[4]; float FLT4; }; // { dg-warning "used" }
google
android
noeffect5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/noeffect5.C
208
utf_8
66a1048126ecd634e1e4f71263be239e
/* PR middle-end/13325 */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n); void f (void *dest, const void *src) { memcpy (dest, src, 0); }
google
android
Wswitch-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wswitch-3.C
629
utf_8
d2e4a4d8e8ab5acfd1a2c4346dddffd3
/* { dg-do compile } */ /* { dg-options "-Wswitch" } */ enum E { A, B, C, D, E, F }; int f1 (enum E e) { switch (e) { case A: return 1; case B: return 2; case C: return 3; case D: return 4; case E: return 5; case F: return 6; case 7: return 7; /* { dg-warning "not in enumerated type"...
google
android
implicit-typename1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/implicit-typename1.C
422
utf_8
d75c242679a546679f0392d6a34e741e
// The -pedantic option must be omitted to trigger the crash. // { dg-do compile } // { dg-options "" } // PR c++/7982: Crash warning about implicit typename. // The base class refers to another typename, while the // name lookup finds a template. template <typename T> struct X {}; template <typename T> struct C { ...
google
android
Wuninitialized-3
.C
toolchain/gcc/gcc-4.9/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
android
pr35602
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr35602.C
432
utf_8
50363ca948a4d64c43b9acf226a68ae9
// PR 35602 Bogus warning with -Wsign-conversion // { dg-do compile } // { dg-options "-Wconversion -Wsign-conversion" } struct c { ~c(); c(); }; int main(const int, const char * const * const) { c x[0UL][0UL] = // { dg-bogus "warning: conversion to .long unsigned int. from .long int. may change the sign ...
google
android
implicit-typename2
.C
toolchain/gcc/gcc-4.9/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
android
Wshadow-compatible-local-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-compatible-local-1.C
1,415
utf_8
7aad846bd39e4e2353d8dd149ef5eb35
/* { dg-do compile } */ /* { dg-options -Wshadow-compatible-local } */ class Bar { }; class ChildBar : public Bar { }; Bar bar; class Foo { private: int val; public: int func1(int x) { int val; val = x; return val; } int func2(int i) { // { dg-warning "shadowed declaration" } int a = 3; ...
google
android
weak1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/weak1.C
724
utf_8
3f4b1f3aaf41418b5d2589dc3ff29113
// { dg-do run } // { dg-require-weak "" } // The PA HP-UX dynamic loader doesn't support unsatisfied weak symbols. // { dg-skip-if "No unsat" { hppa*-*-hpux* } { "*" } { "" } } // { dg-skip-if "No weak unsat" { *-*-aix* } { "*" } { "" } } // The darwin loader does, but they do need to exist at link time. // { dg-skip-...
google
android
Wunused-var-21
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-21.C
286
utf_8
0c5df293cc7c104d4640b26ebae4ed15
// PR c++/58325 // { dg-do compile } // { dg-options "-Wunused" } void f1 () { int *volatile a = new int[1]; delete[] a; } void f2 () { int *b = new int[1]; delete[] b; } void f3 () { int *volatile c = new int; delete c; } void f4 () { int *d = new int; delete d; }
google
android
Wstrict-aliasing-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-5.C
188
utf_8
f203af23e924be80d891b0c53a7bee3e
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ float foo () { unsigned int MASK = 0x80000000; return (float &) MASK; /* { dg-warning "strict-aliasing" } */ }
google
android
Winit-self
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Winit-self.C
136
utf_8
6a51f790f1905c68f12c2109638c7edb
// PR c++/53210 // { dg-options "-Wall" } struct S { S(int i) : j(j) { } // { dg-warning "is initialized with itself" } int j; };
google
android
Wreturn-type-6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-type-6.C
394
utf_8
3fe72d5bf9ad4827aa6ca7d33f8ca73d
/* PR c++/40749 */ /* { dg-do compile } */ /* { dg-options "-Wreturn-type" } */ struct A {}; const A a() {} /* { dg-warning "no return statement" } */ const A& b() {} /* { dg-warning "no return statement" } */ const int c() {} /* { dg-warning "no return statement" } */ template<class T> const int foo(T t) {} /* { dg...
google
android
delete-non-virtual-dtor
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/delete-non-virtual-dtor.C
1,503
utf_8
d30920f4e6c261179db5d5422da0b398
// { dg-options "-Wdelete-non-virtual-dtor" } // { dg-do compile { target c++11 } } struct polyBase { virtual void f(); }; void f(polyBase* p, polyBase* arr) { polyBase pb; delete p; // { dg-warning "non-virtual destructor might" } delete [] arr; } struct polyDerived : polyBase { }; void f(polyDerived* p...
google
android
Wparentheses-24
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-24.C
150
utf_8
30a2aacc6bcdb30c12ed12f8648679cc
// { dg-do compile } // { dg-options "-Wparentheses" } extern int foo (int); bool a, b, c; bool bar () { c = a = b; foo (0); return a = b; }
google
android
format3
.C
toolchain/gcc/gcc-4.9/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
android
Wzero-as-null-pointer-constant-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-4.C
278
utf_8
65537623a1ffdae201b8895dee3c7fe1
// PR c++/51299 // { dg-options "-Wzero-as-null-pointer-constant" } class Base { public: virtual ~Base(); }; class Derived : public Base { }; void foo(Base* b) { Derived* d = dynamic_cast<Derived*>(b); } void bar(Base& b) { Derived& d = dynamic_cast<Derived&>(b); }
google
android
effc2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/effc2.C
701
utf_8
ea529389c86d5a43c531a82630dfde8b
// { dg-do compile } // { dg-options "-Weffc++" } // Contributed by Benjamin Kosnik <bkoz at redhat dot com> // PR c++/16169 : Improve -Weffc++ rule 15 struct A { const A& foo(); const A& operator=(int) { return foo(); } }; struct B { B& foo(); B& operator=(int) { return foo(); } }; struct C { C& operator...