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
Wunused-var-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-3.C
1,150
utf_8
dd0f2a1889a83658587b5f12c08c0c1c
// { dg-options "-Wunused -W" } #include <typeinfo> #include <stdarg.h> void f1 (int a, ...) { va_list ap; va_start (ap, a); va_end (ap); } int f2 (int a, ...) { va_list ap; va_start (ap, a); int i = va_arg (ap, int); va_end (ap); return i; } struct A { int a; A (); virtual ~A (); }; struct B : virt...
google
android
Wstrict-aliasing-1
.C
toolchain/gcc/gcc-4.9/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
android
pr35711
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr35711.C
207
utf_8
218b3d28673859e6199d626c1bb65b1c
// PR 35711 // { dg-do compile } // { dg-options "-Wcast-qual" } int* foo (volatile int *p) { return (int*)p; // { dg-warning "cast from type 'volatile int\\*' to type 'int\\*' casts away qualifiers" } }
google
android
Wunused-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-4.C
553
utf_8
3c7c2b442d4bd62310dcfdd99d91e1b2
// { dg-do compile } // { dg-options "-Wunused-parameter" } // PR c++/9848. Missing warning struct C1 { // Only use in-charge ctor C1(int bi) {} // { dg-warning "unused parameter" "" } }; struct C2 { // Only use base ctor C2(int bi) {} // { dg-warning "unused parameter" "" } }; struct D : C2 { D (int) : C2 ...
google
android
Wstrict-aliasing-bogus-nested-arrays
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C
227
utf_8
b84015e5a6773bd08e2a0f87ad5c4641
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ int foo () { int buffer[10][10]; int* pi = &buffer[0][0]; /* { dg-bogus "same element type" } */ *pi = 10; return buffer[0][0]; }
google
android
register-parm-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/register-parm-1.C
238
utf_8
798f8aae121a1e4adbd067267ee51f1e
// PR c++/60955 // { dg-options "-Wextra" } unsigned int erroneous_warning(register int a) { if ((a) & 0xff) return 1; else return 0; } unsigned int no_erroneous_warning(register int a) { if (a & 0xff) return 1; else return 0; }
google
android
pr23075
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr23075.C
174
utf_8
e821576e9ae56671c4363f0e3e54d39e
// PR c/23075 // { dg-do compile } // { dg-options "-O2 -Wreturn-type" } int foo (void) { return; // { dg-error "with no value" } } // { dg-bogus "no return statement" }
google
android
Wextra-1
.C
toolchain/gcc/gcc-4.9/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
android
Wconversion3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion3.C
1,184
utf_8
7a1aeeb61c3d0cced96983f6490193ae
// PR c++/34198 // { dg-do compile } // { dg-options "-O2 -Wconversion -Wsign-conversion" } signed char sc; unsigned char uc; short int ss; unsigned short int us; int si; unsigned int ui; void test1 (void) { int a = uc & 0xff; int b = sc & 0x7f; int c = 0xff & uc; int d = 0x7f & sc; int e = uc & sc; unsig...
google
android
pr36921
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr36921.C
1,008
utf_8
fb0ed1392cbdeb787735900d17b8c33a
/* PR 36921: comparison operator can be overloaded. Do not emit warnings in such case. { dg-do compile } { dg-options "-Wparentheses" } */ struct A {}; A operator<(A, A) { return A(); } A operator>(A, A) { return A(); } A operator<=(A, A) { return A(); } A operator>=(A, A) { return A(); } A operator==(A, A) { retu...
google
android
ctor-dtor-privacy-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/ctor-dtor-privacy-2.C
97
utf_8
ca9f620c9a4fcfd05cfa551f64c2c55c
struct C { static bool result; private: static bool check(); }; bool C::result = check();
google
android
Wconversion-real-integer-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-real-integer-3.C
765
utf_8
367f8a744194871b508f6692bc267854
// { dg-do compile } // { dg-options "-Wconversion -ftrack-macro-expansion=2" } // { dg-require-effective-target int32plus } #include "conversion-real-integer-3.h" float vfloat; void h (void) { // We want to trigger an error on the token INT_MAX below, that is // a macro that expands to the built-in __INT_M...
google
android
pr21983
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr21983.C
272
utf_8
89bf2aeef07d83dd1991bf02317481b5
// PR c++/21983 // { dg-do compile } struct B { virtual void foo () = 0; }; struct D1 : public virtual B { virtual void foo () {} }; struct D2 : public virtual B { virtual void foo () {} }; struct D : public D1, public D2 { }; // { dg-error "no unique final overrider" }
google
android
Wnvdtor
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnvdtor.C
119
utf_8
c461709cb6d2b6b381cace809e2a380d
// { dg-options "-Wnon-virtual-dtor" } extern "Java" { class Foo { public: virtual void bar( void); }; }
google
android
unit-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/unit-1.C
212
utf_8
832c8f08396e3bbd191312ba09d1d54e
/* { dg-do compile } */ /* { dg-options "-O2 -Wuninitialized" } */ struct a { int mode; }; int sys_msgctl (void) { struct a setbuf; return setbuf.mode; /* { dg-warning "'setbuf.a::mode' is used" "" } */ }
google
android
incomplete2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/incomplete2.C
236
utf_8
c4c3995f1aa28a37cb3873e5212a7682
// PR c++/33501 // { dg-do compile } class A; // { dg-error "forward declaration" } int f (A); // { dg-error "initializing" } const A &make (); int main () { return f (make ()); // { dg-error "invalid use of incomplete type" } }
google
android
format5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/format5.C
237
utf_8
b1b07f098bea0b4e921c1a567adc0834
// PR c++/38980 // { dg-options "-Wformat" } extern "C" int printf(const char *format, ...) __attribute__((format(printf, 1, 2) )); const char fmt1[] = "Hello, %s"; void f() { printf(fmt1, 3); // { dg-warning "expects argument" } }
google
android
Wextra-3
.C
toolchain/gcc/gcc-4.9/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
android
sequence-pt-2
.C
toolchain/gcc/gcc-4.9/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
android
noreturn-7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/noreturn-7.C
318
utf_8
f5f5c1617ee81b4a95bfe5a2c43b2cf3
// PR c++/30988 // { dg-do compile } // { dg-options "-O2 -Wall" } void f (const char *) __attribute__ ((noreturn)); void f (int); void f (double) __attribute__ ((noreturn)); template <typename T> struct A { int g () { f ((T) 0); } // { dg-warning "no return statement in function returning non-void" } };
google
android
Wconversion-null
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-null.C
1,221
utf_8
c0ce42965ebf4e59b1164a436748625c
// { dg-do link } // { dg-options "-Wconversion -Wno-conversion-null -Wno-pointer-arith" } #include <cstddef> void g(int) {} void g(long) {} void g(long long) {} extern void g(void*); template <int I> void h() {} void k(int) {} template <class T> void l(T); template <> void l(int) {} template <> void l(long) {}...
google
android
Wredundant-decls-spec
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wredundant-decls-spec.C
307
utf_8
bc5f141d5ba64d906981c425b810d3ed
// PR c++/15867 // { dg-options -Wredundant-decls } template <typename T> struct S { void foo() {} }; template<> void S<int>::foo(); template<> void S<double>::foo(); // { dg-message "previous declaration" } template<> void S<double>::foo(); // { dg-warning "redundant redeclaration" }
google
android
write-strings
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/write-strings.C
134
utf_8
473862097a6bfdb68fff708f505e14db
// { dg-do compile } // { dg-options -Wwrite-strings } int main() { char* p = "Asgaard"; // { dg-warning "deprecated" } }
google
android
Winline-3
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-11.C
3,515
utf_8
3be49cd413635d5c6d8228545da74c15
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ version of gcc.dg/Wparentheses-8.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
android
Wparentheses-16
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-16.C
2,967
utf_8
9bf24a91b61b697e120b73ae40901d68
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-7.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 "parenthese...
google
android
Wshadow-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-5.C
704
utf_8
9260bcc048ed1f9c50910fe29f589936
// Wshadows was giving warnings for nested function parameters in nested class // or structure that we didn't want. // { dg-do compile } // { dg-options "-Wshadow" } // PR c++/41825 int f (int n) { int bar (int n) { return n++; } // { dg-error "a function-definition is not allowed here" } return bar (n); // { ...
google
android
Wunused-parm-1
.C
toolchain/gcc/gcc-4.9/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
android
pr13358-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr13358-2.C
1,149
utf_8
5ea14e490362652b825c770f9d00d814
// 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 -pedantic-errors" } void use_longlong () { unsigned long long x1, x2, x3; // { dg-error "ISO C\\+\\+ 1998 does not supp...
google
android
main-3
.C
toolchain/gcc/gcc-4.9/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
android
Wconversion4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion4.C
241
utf_8
0588aac3dfc6287be1495e6c0e3563e0
// PR c++/45385 // { dg-options "-Wconversion" } void foo(unsigned char); class Test { void eval() { foo(bar()); // { dg-warning "may alter its value" } } unsigned int bar() const { return __INT_MAX__ * 2U + 1; } };
google
android
Wparentheses-19
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-19.C
4,264
utf_8
57e45fb814d74e86de9c4f3666a82e67
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-10.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
pr31246
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr31246.C
155
utf_8
244727b4d0be90be40b8204cf926d843
// PR 31246 // { dg-do compile } // { dg-options "-Wunreachable-code -D_GLIBCXX_DEBUG" } #include <vector> int main() { std::vector<int>::iterator a; }
google
android
Wunused-8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-8.C
194
utf_8
0d99e205a486cf3984dae4b4c82a1c4f
// PR c++/16029 // { dg-options "-Wunused" } int main () { // We should not see an "unused" warning about "whatever" on the // next line. return whatever (); // { dg-error "declared" } }
google
android
Wunused-16
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-16.C
145
utf_8
aa054897a9a999252af634fb37c47a72
// { dg-do compile } // { dg-options "-Wunused-value" } extern void f1(); void f(bool b) { b ? f1(), 0 : 0; // { dg-bogus "has no effect" } }
google
android
Wunreachable-code-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunreachable-code-1.C
566
utf_8
f3d80e4b7c90755533b6b7bd8812abae
/* PR17544 Incorrect -Wunreachable-code warning G++ appends a "return 0;" when finishing a function, but it was not given a source location. The gimplifier thinks a return statement needs a locus so it would add one, making the compiler generated code visible to the unreachable code warning. */ /* { dg-do...
google
android
Wunused-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-3.C
178
utf_8
100b96f03eb66e7fa747a34b5fb876bb
// { dg-do compile } // { dg-options "-Wunused -O -fno-use-cxa-atexit" } void do_cleanups(); class Cleanup { public: ~Cleanup() { do_cleanups();} }; static Cleanup dummy;
google
android
sequence-pt-pr17880
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/sequence-pt-pr17880.C
2,561
utf_8
df6eec31c99dfed294a6e4192dd69f3f
// PR 17880 // { dg-do compile } // { dg-options "-Wsequence-point" } int foo (int x) { unsigned int a; int b; b = (a += 5) > a; // { dg-warning "undefined" "sequence point warning" } b = (a += 5) + a == 10; // { dg-warning "undefined" "sequence point warning" } b = (a -= 5) > a; // { dg-warning "undefin...
google
android
Woverflow-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Woverflow-2.C
149
utf_8
9bc388e58bfd1cdb62f20ded1e767644
/* { dg-do compile } */ /* { dg-options "-O2 -Woverflow" } */ #include <limits.h> int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */
google
android
Wnvdtor-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnvdtor-2.C
1,266
utf_8
8c56c916a791bfbd1ac25b63b43b766c
// PR c++/7302 // { dg-do compile } // { dg-options "-Wnon-virtual-dtor" } // Warn when a class has virtual functions and accessible non-virtual // destructor, in which case it would be possible but unsafe to delete // an instance of a derived class through a pointer to the base class. struct A { protected: ~A(); /...
google
android
Wunused-var-19
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-19.C
267
utf_8
aabf762ebe53d9bdf29cd7607fc1fe32
// PR c++/55643 // { dg-do compile { target c++11 } } // { dg-options "-Wunused" } enum class E { e = 123 }; int foo () { E x = E::e; return (double) x; } int bar () { E x = E::e; return (long double) x; } int baz () { E x = E::e; return (float) x; }
google
android
Wswitch-default-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wswitch-default-1.C
274
utf_8
ec17a45e76ade076a9d23dd01ca9751f
// PR C++/21123 /* { dg-do compile } */ /* { dg-options "-Wswitch-default" } */ template <typename ArrayType> void foo( ) { int i = 0; switch ( i ) /* { dg-bogus "switch missing default case" } */ { case 9: default: break; } } void f() { foo<int>(); }
google
android
pr34985
.C
toolchain/gcc/gcc-4.9/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
android
Wunused-15
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-15.C
213
utf_8
04ac62179b35dfe46c9f95baa7db1afb
// PR c++/39875 // { dg-do compile } // { dg-options "-Wunused-value" } int *i; void foo () { *i++; // { dg-warning "value computed is not used" } (void) *i++; // { dg-bogus "value computed is not used" } }
google
android
pr35635
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr35635.C
3,264
utf_8
82356b79d57fd1b4c5566e5e68eb6043
/* PR 35635 */ /* { dg-do compile } */ /* { dg-options "-Wconversion -Wsign-conversion" } */ struct unsigned_bit { unsigned int x:1; } unsigned_bit; struct signed_bit { int x:1; } signed_bit; int bar; int bar2; void func1() { /* The result of boolean operators fits in unsiged int:1, thus do not warn. */ ...
google
android
Wconversion-real-integer
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C
3,048
utf_8
83f25a4a0c15a025b671a5728685be6c
/* Test for diagnostics for Wconversion between floating-point and integers. C++ equivalent of gcc/testsuite/gcc.dg/Wconversion-real-integer.c */ /* { dg-do compile } /* { dg-options "-Wconversion -ftrack-macro-expansion=0" } */ /* { dg-require-effective-target int32plus } */ #include <limits.h> void fsi (signe...
google
android
Wdelete-incomplete-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wdelete-incomplete-2.C
111
utf_8
e5cc13e8f74ebb47c678a7c5745e57a8
// PR c++/43452 // { dg-options -Wno-delete-incomplete } class Foo; int main() { Foo* p; delete [] p; }
google
android
pr11159
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr11159.C
383
utf_8
adea0a023eba0c3c51b6a4894014d35a
// PR c++/11159 : erroneous warning in copy ctor with virtual inheritance // { dg-do compile } // { dg-options "-Wall -Wextra" } struct A { A (); }; struct B : virtual A { B (); }; struct C : virtual A { C (); }; struct D : B, C { D (D const&){} }; template <typename Base> struct E : Base { E (); E (E ...
google
android
Wunused-var-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-1.C
362
utf_8
4f806576508d70a95ed2a3e232685cdb
// { dg-options "-Wunused" } template <int> struct X { static const int s = 2; }; template <typename T> int f() { const int v = 2; return X<v+1>::s; } template <typename T> int g() { const int v = 2; return X<v>::s; } template <typename T> int h() { const int v = 2; return X<1 ? v : 0>::s; } template int f<int>(); temp...
google
android
Wenum-compare-no
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wenum-compare-no.C
251
utf_8
0159dc16051c0a3deaba6db2eeae85f8
/* Test disabling -Wenum-compare (on by default). See PR27975. */ /* { dg-do compile } */ /* { dg-options "-Wno-enum-compare" } */ enum E1 { a }; enum E2 { b }; int foo (E1 e1, E2 e2) { return e1 == e2; /* { dg-bogus "comparison between" } */ }
google
android
write-strings-default
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/write-strings-default.C
140
utf_8
41dc346d5678dfa4632f8a0389b3f2c2
// { dg-do compile } // Test the default for -Wwrite-strings int main() { char* p = "Asgaard"; // { dg-warning "deprecated" } }
google
android
implicit-typename3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/implicit-typename3.C
273
utf_8
5d559af51cd6e5fbe0dbb5a62a5d3366
// { dg-do compile } // PR c++/11039: Implicit typename warning in friend class declaration. template <typename T> struct X { struct Y { struct Z {}; }; template <typename U> friend struct Y::Z f(U); };
google
android
Wlogical-op-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C
1,603
utf_8
90a871726cae9dea93ce0da4b5bb7b2c
// { dg-do compile } // { dg-options "-Wlogical-op" } enum { a, b1, b2 }; enum testenum { t1, t2}; extern int c; extern bool bool_a, bool_b; template<typename Enum> class QFlags { public: typedef void **Zero; int i; inline QFlags(Enum f) : i(f) {} inline operator int() const { return i;} }; Q...
google
android
Wstrict-aliasing-bogus-const
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-const.C
194
utf_8
ac260e0cd387ad68b172cae5830684be
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ int foo(int* p) { const int& q = *p; /* { dg-bogus "const vs. non-const" } */ *p = 1; return q; }
google
android
Wparentheses-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-3.C
233
utf_8
f54d3fb57e7ea75f1954d2671e769fd5
// Test that -Wparentheses does not give bogus warnings in the // presence of templates. Bug 17041. // { dg-do compile } // { dg-options "-Wparentheses" } template<int> struct A { int i; A() { if ((i = 0)) ; } }; A<0> a;
google
android
Woverloaded-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Woverloaded-1.C
217
utf_8
4d3b7ed38b5e078db7e76014e7eab321
/* { dg-options "-Woverloaded-virtual" } */ class Base { public: virtual ~Base() { } }; class Derived: public Base { public: int Base() { // There should be no error here. return 5; } }; int main() { }
google
android
Wunused-var-11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-11.C
260
utf_8
16cd18b051568e2b0d1ed53dfcd6fc38
// PR c++/44412 // { dg-do compile } // { dg-options "-Wunused" } struct S { int foo (); static int bar (); }; int S::foo () { return 5; } int S::bar () { return 6; } int f1 () { S s; return s.foo (); } int f2 () { S s; return s.bar (); }
google
android
Wstrict-aliasing-8
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-8.C
372
utf_8
71435332433246858548fb92a3a29591
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2 -Wall" } */ int a[2]; double *foo1(void) { return (double *)a; /* { dg-warning "strict-aliasing" } */ } double *foo2(void) { return (double *)&a[0]; /* { dg-warning "strict-aliasing" } */ } __complex__ double x; int *bar(void) { return (int *)&_...
google
android
Wunused-parm-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-parm-5.C
513
utf_8
1b3033be001938ddae7fa23f9f2b07a0
// PR c++/58362 // { dg-options "-Wunused-parameter" } void f1 (long s) { } // { dg-warning "15:unused parameter 's'" } void f2 (long s, int u) { } // { dg-warning "15:unused parameter 's'" } // { dg-warning "22:unused parameter 'u'" "" { target *-*-* } 6 } void f3 (long s); void f3 (long s) { } // { dg-warning "...
google
android
multiple-overflow-warn-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-3.C
301
utf_8
2979544e46142cf2eb10573c7d884767
/* PR 30465 : Test for duplicated warnings in a conversion. */ /* { dg-do compile } */ /* { dg-options "-Woverflow" } */ short int g (void) { short int wc = ((short int)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */ /* { dg-warning "overflow" "" { target *-*-* } 8 } */ return wc; }
google
android
Wextra-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wextra-2.C
307
utf_8
fd872aba23fcbd09e4b5cb3b61dbaadf
// { dg-options "-Wextra" } struct S { S(); }; struct T { private: int i; public: // There should be no warning about this data member because the // default constructor for "T" will invoke the default constructor // for "S", even though "S" is "const". const S s; // { dg-bogus "const" } };
google
android
Wdtor1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wdtor1.C
347
utf_8
ee0b4d9e331b2ed8b1a730e066fc0084
// PR c++/20145 // { dg-options "-Wnon-virtual-dtor" } # 1 "t.cc" # 1 "<built-in>" # 1 "<command line>" # 1 "t.cc" # 1 "include/t.h" 1 3 4 // Declare the template with explicit C++ linkage in case system // headers have implicit C linkage. extern "C++" { template <int> class t { virtual void f(); }; } # 2 "t.cc" 2 v...
google
android
conv1
.C
toolchain/gcc/gcc-4.9/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
android
Wunused-var-7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-7.C
708
utf_8
b81dd316dd30881afe998cc16667340f
// { dg-do compile } // { dg-options "-Wunused" } template <int N> void f1 (void) { _Complex int a; // { dg-warning "set but not used" } _Complex double b; // { dg-warning "set but not used" } __real__ a = 1; __imag__ a = 2; __real__ b = 3.0; __imag__ b = 4.0; } template <int N> int f2 (void) { _Complex...
google
android
Wstrict-aliasing-bogus-placement-new
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-placement-new.C
415
utf_8
f345b06fca626501d991adc9447c18e0
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing" } */ inline void *operator new (__SIZE_TYPE__, void *__p) throw() { return __p; } struct Y { Y() {} int i; }; struct X { X() {} void construct(const Y& y) { new (&m_data[0]) Y(y); } bool initialized; char m_data[sizeof (Y)]; }; void...
google
android
Wunused-var-9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-9.C
173
utf_8
66e0712402c08575f2486cc95d89f9b2
/* PR c++/44062 */ /* { dg-do compile } */ /* { dg-options "-Wunused" } */ void f () { int i = 4; static_cast <void> (i); int j; j = 5; static_cast <void> (j); }
google
android
Wuninitializable-member-no
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wuninitializable-member-no.C
393
utf_8
0101ac7bc499a86bdbc20c8ef3cfa386
// Test disabling // { dg-do compile } // { dg-options "-Wall -Wextra -Wno-uninitialized" } class X { int & flag;// { dg-bogus "non-static reference 'int& X::flag' in class without a constructor" } public: void f(){ flag++ ; } }; class Y { const int var;// { dg-bogus "non-static const member 'const int Y::var'...
google
android
Wstring-literal-comparison-2
.C
toolchain/gcc/gcc-4.9/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
android
pr26785
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr26785.C
166
utf_8
fb38f2b2dda09170136a0c3ac84bcb3a
// PR 26785 // { dg-do compile } // { dg-options "-fshow-column" } class foo { foo::foo // { dg-error "3:extra qualification" } (int a, int b, int c); };
google
android
Wuninitialized-1
.C
toolchain/gcc/gcc-4.9/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
android
pr31246-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr31246-2.C
141
utf_8
84831d5a90ad5ab8e3340081ef6763e5
// PR 31246 // { dg-do compile } // { dg-options "-Wunreachable-code" } #include <new> int* get_ptr(void* ptr) { return new(ptr) int(); }
google
android
pragma-system_header5
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-12
.C
toolchain/gcc/gcc-4.9/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
android
conv4
.C
toolchain/gcc/gcc-4.9/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
android
deprecated-4
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-6
.C
toolchain/gcc/gcc-4.9/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
android
anonymous-namespace-6
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/anonymous-namespace-6.C
104
utf_8
be3d4fa6911580b9269c3ea654b72a7e
// PR c++/53711 // { dg-options -Wall } namespace { void f () // { dg-warning "not used" } { } }
google
android
pr8715
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr8715.C
192
utf_8
a6a330b9948ca9b7ebe194a6edd63903
/* { dg-do compile } */ /* { dg-options "-Wsign-compare" } */ int foo() { unsigned char b = '1'; bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */ return 0; }
google
android
Wparentheses-25
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-25.C
9,471
utf_8
c800cdb325b2c16421f6bdf47aae1930
/* PR 7543. Test operation of -Wparentheses. Precedence warnings. !a | b and !a & b. */ /* { dg-do compile } */ /* { dg-options "-Wparentheses" } */ // C++ version of Wparentheses-11.c int foo (int); int bar (int a, int b, int c) { foo (!a & b); /* { dg-warning "parentheses" "correct warning" { xfail *-*-* } }...
google
android
Wreturn-type-9
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-type-9.C
689
utf_8
11c96d177204bba0d28acdba72d60115
// related to PR c++/55189 // { dg-options "-Wreturn-type" } int f1() { while (true) { } } int f2() { while (true) { break; } } // { dg-warning "no return statement" } int f3() { for (;;) {} } int f4() { for (;;) {break;} } // { dg-warning "no return statement" } int f5() { do {} while(true); } int f6() { ...
google
android
Wunused-11
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-11.C
171
utf_8
509e856e0fc2084da098b641f1d63e89
// PR c++/20212 // { dg-options "-O2 -Wunused -Wextra" } template<int> void f(int); void g(int i) { f<0>(i); } template<int> void f(int i __attribute__((unused)) ) {}
google
android
Wenum-compare-no-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wenum-compare-no-2.C
810
utf_8
8b9cbae2542d0ee1294a9aba56467023
// PR c++/53524 // { dg-options "-Wno-enum-compare" } template < typename > struct PointerLikeTypeTraits { enum { NumLowBitsAvailable }; }; class CodeGenInstruction; class CodeGenInstAlias; template < typename T> struct PointerIntPair { enum { IntShift = T::NumLowBitsAvailable }; }; template < typename PT1, typ...
google
android
Warray-bounds-5
.C
toolchain/gcc/gcc-4.9/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
android
Wparentheses-10
.C
toolchain/gcc/gcc-4.9/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
android
pr13358-4
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr13358-4.C
1,182
utf_8
94b8517c60747ecac37644cd78124eca
// PR c++/13358: g++ should accept a long long constant sans LL suffix // if -Wno-long-long is in use. // { dg-do compile { target c++11 } } // { dg-require-effective-target int32plus } // { dg-options "-pedantic-errors -Wlong-long" } void use_longlong () { unsigned long long x1, x2, x3; // { dg-warning "ISO C\\+\...
google
android
Wdiv-by-zero-bogus
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wdiv-by-zero-bogus.C
483
utf_8
5fcfe548724a8bcc0d056db26a655d5a
// PR c++/52299 template<unsigned x> struct test0 { static const unsigned a_ = x ? 10 / x : 10; }; template<unsigned x> struct test1 { static const unsigned a_ = !x ? 10 : 10 / x; }; template<bool x> struct test2 { static const unsigned a_ = x ? 10 / x : 10; }; template<bool x> struct test3 { static c...
google
android
Wsign-compare-7
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsign-compare-7.C
261
utf_8
182345b582b831afb2700ff45a395589
// PR c++/59231 // { dg-options "-Wsign-compare" } template<class X, class Y> bool equals(X x, Y y) { return (x == y); // { dg-warning "signed" } } int main() { unsigned long x = 2; signed int y = 2; if(!equals (x, y)) return 1; return 0; }
google
android
main
.C
toolchain/gcc/gcc-4.9/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
android
Wunused-var-15
.C
toolchain/gcc/gcc-4.9/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
android
Wself-assign-3
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-3.C
548
utf_8
8fefadd9596b0edb425f61f3304e73ad
// Test how operands_equal_p handles a NULL operand. // { dg-do compile } // { dg-options "-Wself-assign" } #include <cstdio> namespace testing { class Foo { int f; public: Foo() { printf("Construct Foo\n"); } }; class Bar { int b; public: Bar(int x) { printf("Construct Bar\n"); } void operator=(const ...
google
android
Wunused-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-5.C
270
utf_8
a1eac98a6496704d61be03bb58327d0f
/* PR opt/14288 */ /* { dg-do compile } */ /* { dg-options "-O -Wall" } */ volatile int sink; extern int foo(int); struct S { int x; S() { x = foo(0); } ~S() { sink = x; } }; int test(bool p) { return p ? foo(S().x) : 0; /* { dg-bogus "uninitialized" } */ }
google
android
Winline-1
.C
toolchain/gcc/gcc-4.9/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
android
Wsequence-point-2
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsequence-point-2.C
320
utf_8
d0d6c5fe9b201bcd8b68523fbf3f0ce2
// PR c++/45894 // { dg-do compile { target c++11 } } // { dg-options "-Wsequence-point" } struct F { template <typename = int> void bar (); }; template <typename = int> struct V { V (const V &) { F::bar <>; } }; struct C { V <> v; }; struct B { C f (); }; struct A { C c; B b; A () : c (b.f ()) { } };
google
android
ctor-dtor-privacy-1
.C
toolchain/gcc/gcc-4.9/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
android
Wunused-var-18
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-18.C
169
utf_8
b44ce135d8c96099ca5e30272b8ceaa0
// Origin: PR c++/29028 // { dg-options "-Wunused" } // { dg-do compile } namespace N { int i; // { dg-warning "unused variable" } } void f () { using N::i; }
google
android
anonymous-namespace-5
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/anonymous-namespace-5.C
85
utf_8
6b75beb82727fa901a97c3f415f79fd3
namespace { void f(); // { dg-message "never defined" } } int main() { f(); }
google
android
register-var-1
.C
toolchain/gcc/gcc-4.9/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
android
Woverflow-3
.C
toolchain/gcc/gcc-4.9/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
android
Wstrict-aliasing-bogus-signed-unsigned
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C
243
utf_8
443205fcd20b9b14da1367b1b8e16bce
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ int foo () { int i; unsigned int* pu = reinterpret_cast<unsigned int*> (&i); /* { dg-bogus "signed vs. unsigned" } */ *pu = 1000000; return i; }
google
android
Wsizeof-pointer-memaccess-1
.C
toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsizeof-pointer-memaccess-1.C
380
utf_8
3c32b12d4568ba73d1a2d996aa55746a
// Test -Wsizeof-pointer-memaccess warnings. // { dg-do compile } // { dg-options "-Wall" } typedef __SIZE_TYPE__ size_t; extern "C" void *memset (void *, int, size_t); int foo (int x, char b[10]) { long a[memset (b, 0, sizeof (b)) ? x + 10 : x]; // { dg-warning "call is the same expression as the destination; did ...