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
undefined1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/undefined1.C
205
utf_8
81ccb812ec92857cf80d860b4ffa0d31
// PR 17256 inline static void f1(void); // { dg-warning "used but never" } void g1(void) { if (0) { f1(); } } inline void f2(void); // { dg-warning "used but never" } void g2(void) { if (0) { f2(); } }
google
chromium
noeffect5
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-bogus-signed-unsigned
.C
native_client/nacl-gcc/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
chromium
Wunused-9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-9.C
779
utf_8
c028f96ef429d16acd56c46dd1ef7140
// PR c++/11224 // { dg-options "-Wunused" } struct someclass { bool isEmpty() const { return true; } }; int main() { bool bOk = false; someclass foo; bOk == foo.isEmpty(); // { dg-warning "not used" } return bOk; } int& f(); void g() { f() == 0; // { dg-warning "not used" } f() != 1; // { dg-warni...
google
chromium
Wparentheses-19
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-19.C
4,268
utf_8
2bf598d7e9ea9cfeb779a0d90d2be1d8
// { 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
chromium
noreturn-3
.C
native_client/nacl-gcc/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
chromium
Wcast-qual1
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-bogus-base-derived
.C
native_client/nacl-gcc/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
chromium
pr30636
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr30636.C
409
utf_8
40f3a713eb0d35566b12333645fb0772
/* { dg-do compile } */ /* { dg-options "-O2 -Warray-bounds" } */ typedef char one_buffer[512]; static one_buffer emergency_buffer[4]; void free_exception (void *vptr) { char *base = (char *) &emergency_buffer[0][0]; char *ptr = (char *) vptr; if (ptr >= base && ptr < base + sizeof (emergency_buffer)) /* { dg-b...
google
chromium
pmf1
.C
native_client/nacl-gcc/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
chromium
Wswitch-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wswitch-1.C
1,302
utf_8
a6c41dcd4c09f3501aad8a911a32cbf2
/* 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
chromium
write-strings
.C
native_client/nacl-gcc/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
chromium
effc1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/effc1.C
358
utf_8
5e598309e0a011e0e37afcaf0b658c4f
// { dg-options -Weffc++ } // { dg-do compile } // Bug 5719 class A { public: A & operator+=( int ); A & operator+( int ); // { dg-warning ".* should return by value" "" } A operator+=( float ); A operator+( float ); };
google
chromium
Wuninitializable-member-no
.C
native_client/nacl-gcc/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
chromium
pr36999
.C
native_client/nacl-gcc/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
chromium
implicit-typename3
.C
native_client/nacl-gcc/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
chromium
anonymous-namespace-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/anonymous-namespace-3.C
285
utf_8
43f33b0230eba15de4dc68858b227d06
// Test for the warning of exposing types from an anonymous namespace // { dg-do compile } // #include <memory> #include "anonymous-namespace-3.h" struct B { std::auto_ptr<A> p; }; #line 10 "foo.C" struct C { // { dg-warning "uses the anonymous namespace" } std::auto_ptr<A> p; };
google
chromium
Winline-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Winline-2.C
92
utf_8
0e30443ee25811cad88723354c525b24
// PR c++/10929 // { dg-options "-Winline -O3" } int foo (); int bar () { return foo (); }
google
chromium
overflow-warn-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
4,021
utf_8
f0e61871be68e9802896258e55a239bf
/* { dg-do compile } */ /* { dg-options "" } */ #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 by zero" "" { xfa...
google
chromium
conv3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/conv3.C
66
utf_8
cc281c397d45da8c573eee459fc65fa7
// PR c++/19457 int i=-1; unsigned int j= ~0; // { dg-bogus "" }
google
chromium
Walways-true-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Walways-true-1.C
1,433
utf_8
31374840ed3137c47aa43f8aefc76125
// Test -Waddress for testing an address against NULL. // { dg-do compile} // { dg-options "-Waddress" } extern int foo (int); int i; void bar (int a) { lab: if (foo) // { dg-warning "always evaluate as" "correct warning" } foo (0); if (foo (1)) ; if (&i) // { dg-warning "always evaluate as" "correct war...
google
chromium
template-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/template-1.C
351
utf_8
6f90eb3a0f4a4e7f096197fba7797aff
//PR c++/11490 //Since N is know at instantiation time, there // should be no warning about comparision between // unsinged and signed interegers. // { dg-do compile } // { dg-options "-W" } template <int N> bool f() { unsigned int i=0; return i!=N; // { dg-bogus "signed and unsigned" } } template bool f<2> ();
google
chromium
pr23075
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr23075.C
176
utf_8
9f46d0be09249c34a6a9b97b99dcec35
// PR c/23075 // { dg-do compile } // { dg-options "-O2 -Wreturn-type" } int foo (void) { return; // { dg-error "with no value" } } // { dg-warning "no return statement" }
google
chromium
Wbraces2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wbraces2.C
715
utf_8
c2debf54ffb3d60acfddad10573c458f
// PR c++/20175 // { dg-options "-Wmissing-braces" } int a[2][2] = { 0, 1, 2, 3 }; // { dg-warning "missing braces" } int b[2][2] = { { 0, 1 }, { 2, 3 } }; int c[2][2] = { { { 0 }, 1 }, { 2, 3 } }; // { dg-error "braces around scalar" } struct S { char s[6]; int i; }; S d = { "hello", 1 }; S e = { { "hello" }, 1 };...
google
chromium
null4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/null4.C
836
utf_8
5c5db225cc578c354ad113422ce184e6
// PR c++/24745 : warnings for NULL constant. // { dg-do compile } // { dg-options "-Wpointer-arith -Wconversion " } #include <cstddef> int foo (void) { if (NULL == 1) return -1; // { dg-warning "NULL used in arithmetic" } if (NULL > NULL) return -1; // { dg-warning "NULL used in arithmetic" } if (NULL < ...
google
chromium
Wuninitialized-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wuninitialized-4.C
303
utf_8
be5b47714ba41b25933660896d6c7427
// 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 1 ... __INT_MAX__: j = 4; break; } return j; }
google
chromium
Wshadow-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wshadow-1.C
1,059
utf_8
5f3bcedcf90b0a88ec7f6f5dc569ce69
/* { 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
chromium
Wparentheses-20
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-20.C
3,602
utf_8
bb97c3c25bd923a37712b522c7f1f614
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-11.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
chromium
Wreturn-type-6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-type-6.C
396
utf_8
e54502fc6abef190bf580b1fbcf501ac
/* 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) {} /* { ...
google
chromium
Wstrict-aliasing-8
.C
native_client/nacl-gcc/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
chromium
pr33738
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr33738.C
398
utf_8
cb6fc0dc164cb69b0706664d0efc0ea1
// { dg-do run } // { dg-options "-O2 -Wtype-limits" } extern void link_error (void); enum Alpha { ZERO = 0, ONE, TWO, THREE }; Alpha a2; int m1 = -1; int GetM1() { return m1; } int main() { a2 = static_cast<Alpha>(GetM1()); if (a2 == -1) { // { dg-warning "always false due" } link_error (); } if (-1 == a...
google
chromium
Wfloat-equal-1
.C
native_client/nacl-gcc/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
chromium
Wparentheses-14
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-14.C
586
utf_8
e151ff9706ff8f8d25eb870b6f099bc2
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-2.C. int foo (int); int a, b, c; bool d; template<class T> void bar (T) { if (a += b) foo (0); if (a -= a) foo (1); if (b *= c) foo (2); else foo (3); if (b /= b) foo (4); else foo (5); w...
google
chromium
Wstrict-aliasing-float-ref-int-obj
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C
336
utf_8
4e99d85b0010de275209c6759c92557e
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ int foo() { int x; float& q = reinterpret_cast<float&> (x); /* { dg-message "initialized" } */ q = 1.0; /* { dg-warning "does break strict-aliasing" } */ return x; } /* { dg-message "dereferencing type-punned" "" { target...
google
chromium
pr8715
.C
native_client/nacl-gcc/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
chromium
pr30551
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr30551.C
315
utf_8
8cfb784bce12acc66c8663f55f1f3481
// PR 30551 -Wmain is enabled by default. // { dg-do compile } // { dg-options "" } // { dg-skip-if "-Wmain not enabled on SPU" { spu-*-* } } int main(char a) {} /* { dg-warning "first argument of .*main.* should be .int." } */ /* { dg-warning "main.* takes only zero or two arguments" "" { target *-*-* } 5 } */
google
chromium
pointer-integer-comparison
.C
native_client/nacl-gcc/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
chromium
Wparentheses-11
.C
native_client/nacl-gcc/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
chromium
ignored_typedef
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/ignored_typedef.C
830
utf_8
8ab4f00d5edff6f6c7baa38049347237
// PR c++/23689 // Test that malformed typedef's produce a compiler warning. typedef char valid_0; typedef int valid_1; typedef long valid_2; typedef float valid_3; typedef double valid_4; typedef unsigned valid_5; typedef int *valid_6; typedef struct valid_7 {} valid_8; typedef struct {} valid_9; typedef int temp_0; ...
google
chromium
pragma-system_header3
.C
native_client/nacl-gcc/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
chromium
Wparentheses-8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-8.C
851
utf_8
1440e102f955e4e422a63b32d881465f
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ version of gcc.dg/Wparentheses-5.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" "corr...
google
chromium
noeffect6
.C
native_client/nacl-gcc/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
chromium
pragma-system_header4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pragma-system_header4.C
93
utf_8
1fdb0226c11f07a183a891197a82305b
// PR c++/32256 // { dg-options "-Wall" } #include "pragma-system_header4.h" void ok() { }
google
chromium
Wreturn-type-3
.C
native_client/nacl-gcc/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
chromium
Wunused-1
.C
native_client/nacl-gcc/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
chromium
Wdiv-by-zero
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wdiv-by-zero.C
156
utf_8
c71f5fb3792e0ba57c0a4e43cd39038f
// test that division by zero warnings are enabled by default int breakme() { int x = 0; x /= 0; // { dg-warning "division by" } return x; }
google
chromium
Wlogical-op-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C
1,078
utf_8
a841cc2e2aef864cd61c9ccd3df0f003
// { 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;} }; QF...
google
chromium
Warray-bounds
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Warray-bounds.C
2,453
utf_8
f5eb6c2422098ba976ee77f44b4ca93c
/* { dg-do compile } */ /* { dg-options "-O2 -Warray-bounds" } */ int a[10]; static inline int n(void) { __SIZE_TYPE__ strlen(const char *s); 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
chromium
Wparentheses-23
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-23.C
2,377
utf_8
3f7e8bba62a8857d7cdee73ed7c315b7
// { dg-do compile } // { dg-options "-Wparentheses" } // Template version of Wparentheses-22.C. int foo (int); class C { public: C() : b(0) { } // Use default assignment constructor. // Provide conversion to bool so that an instance of this class will // work as a condition. operator bool() const...
google
chromium
Wparentheses-21
.C
native_client/nacl-gcc/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
chromium
implicit-typename1
.C
native_client/nacl-gcc/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
chromium
oldcast1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/oldcast1.C
384
utf_8
33e37856b8391737e80c51371895ce7d
// { dg-do compile } // { dg-options "-ansi -pedantic-errors -Wold-style-cast" } // PR 5089. old style cast to void should be permitted (think assert) void foo () { int i; float f = (float)i; // { dg-warning "use of old-style cast" "" } (void)i; }
google
chromium
conv2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/conv2.C
106
utf_8
8cdb559ffcb9d887ccbede485723468a
// PR c++/13932 // { dg-options "-Wconversion" } int i = 1.; int j = 1.1; // { dg-warning "conversion" }
google
chromium
Wunused-6
.C
native_client/nacl-gcc/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
chromium
pr36921
.C
native_client/nacl-gcc/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
chromium
format2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/format2.C
1,489
utf_8
77cfd7b8f34afd97ff68bc102b6c6fc6
// Test for format attributes: test applying them to types in C++. // { dg-do compile } // { dg-options "-Wformat" } __attribute__((format(printf, 1, 2))) void (*tformatprintf0) (const char *, ...); void (*tformatprintf1) (const char *, ...) __attribute__((format(printf, 1, 2))); void (__attribute__((format(printf, 1, ...
google
chromium
Wparentheses-16
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-16.C
2,971
utf_8
d87dd62f86bc0dc77c7e9fcdd2d600a9
// { 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
chromium
Wconversion-real-integer
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C
3,022
utf_8
778d5f6c7ca820866b90899853dc4fa7
/* 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" } */ /* { dg-require-effective-target int32plus } */ #include <limits.h> void fsi (signed int x); void fui (unsign...
google
chromium
Wstrict-aliasing-bogus-escape-2
.C
native_client/nacl-gcc/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
chromium
incomplete2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/incomplete2.C
225
utf_8
49b98998b847037288aea7d208c298d7
// PR c++/33501 // { dg-do compile } class A; // { dg-error "forward declaration" } int f (A); const A &make (); int main () { return f (make ()); // { dg-error "invalid use of incomplete type|initializing argument" } }
google
chromium
Wstrict-aliasing-bogus-char-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-char-1.C
204
utf_8
d4573ac3640698442e2e693aacce94bb
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ int foo () { int i; char* c= reinterpret_cast<char*>(&i); /* { dg-bogus "char" } */ c[1] = 1; return i; }
google
chromium
sequence-pt-pr17880
.C
native_client/nacl-gcc/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
chromium
no-write-strings
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/no-write-strings.C
98
utf_8
941aec727045c0f85cb4623dd4ce20f1
// { dg-do compile } // { dg-options -Wno-write-strings } int main() { char* p = "Asgaard"; }
google
chromium
pr26785
.C
native_client/nacl-gcc/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
chromium
multiple-overflow-warn-3
.C
native_client/nacl-gcc/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
chromium
Wunused-12
.C
native_client/nacl-gcc/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
chromium
if-empty-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/if-empty-1.C
484
utf_8
450618a497d9ab1567d9bc1ed188ded4
/* { dg-do compile } */ /* { dg-options "-Wempty-body" } */ void f (int x) { if (x) ; /* { dg-warning "suggest braces around empty body in an" } */ if (x) ; /* By design we don't warn in this case. */ else (void)0; if (x) (void)0; else ; /* { dg-warning "suggest braces around empty body i...
google
chromium
pragma-system_header1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pragma-system_header1.C
123
utf_8
4cf78b7f61fb98cbc6e1ef39bf3dc758
// PR c++/30500 // { dg-options "-Wconversion" } #include "pragma-system_header1.h" void f() { g<int>(); h<int>(); }
google
chromium
effc2
.C
native_client/nacl-gcc/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...
google
chromium
vector3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vector3.C
128
utf_8
06e44a4208434952189cfd9cd55ae2d8
/* { dg-do compile } */ /* { dg-options "" } */ // PR c++/28302 int __attribute__((vector_size(8))) x; void foo() { ~x; }
google
chromium
attrib15
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib15.C
84
utf_8
39e052366a96099f26b671796340eb37
// PR c++/15317 struct A { A(char); }; A::A(__attribute__((unused)) char i2) {}
google
chromium
has_nothrow_assign_odr
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
260
utf_8
f6720c770e2fb1754a72d71b0c26db42
// PR c++/36870 // { dg-do "run" } #include <cassert> struct S { const S& operator= (const S&); }; bool f (); int main () { assert (__has_nothrow_assign (S) == f ()); } const S& S::operator= (const S&) { } bool f () { return __has_nothrow_assign (S); }
google
chromium
has_nothrow_copy-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C
193
utf_8
c20d3d9a8fa209a83bd3468ab940233e
// PR c++/36871 // { dg-do "run" } #include <cassert> struct F { F (const F&) throw () { } template <class T> F (T) throw () { } }; int main () { assert (__has_nothrow_copy (F)); }
google
chromium
tmplattr3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/tmplattr3.C
942
utf_8
ff67a3df89d9e5bed9e2259c840fd1c3
// PR c++/17743 template<typename T> struct X { typedef char layout_type[sizeof(T)] __attribute ((aligned(__alignof(double)))); layout_type data; }; template<typename T> struct Y { typedef char layout_type[sizeof(T)] __attribute ((aligned(__alignof(T)))); layout_type data; }; template<typename T> struct ...
google
chromium
oper1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/oper1.C
449
utf_8
8f3e3432664712c939fe6dea74deb533
// { dg-do run } // Make sure the GNU extension of accepting dropping cv-qualifiers for // the implicit this argument does not kick in when taking the address // of an object, since this extension would change the meaning of a // well-defined program. struct A { A* operator&() { return 0; } }; int main () { const A...
google
chromium
array1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/array1.C
159
utf_8
691a47a228a5fa12f281a771f2c53825
// PR c++/13574 // { dg-options "" } class A { public: A() : argc(0), argv() { }; private: int argc; char* argv[]; }; int main() { A y; }
google
chromium
utf32-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf32-1.C
947
utf_8
372b29c6fdb5613760a00a19b01a0604
/* Test the support for char32_t character constants. */ /* { dg-do run } */ /* { dg-options "-std=c++0x -Wall -Werror" } */ extern "C" void abort (void); const static char32_t c0 = U'a'; const static char32_t c1 = U'\0'; const static char32_t c2 = U'\u0024'; const static char32_t c3 = U'\u2029'; const static char32_t ...
google
chromium
dllimport7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/dllimport7.C
892
utf_8
23d15ef27e094ea705f3ac33ec67560b
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } // Report errors on definition of dllimport'd static data member . struct Baz { Baz(int a_ =0) : a(a_) {} int a; }; class __declspec(dllimport) Bar { public: enum {one = 1}; static const int two = 2; static const int three; static...
google
chromium
cleanup-6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/cleanup-6.C
286
utf_8
d9e45b781a97ee5ac71b788011eae52c
/* { dg-do compile } */ /* { dg-options "-O" } */ /* Verify that a cleanup marked "inline" gets inlined. */ static inline void xyzzy(void *p __attribute__((unused))) { } void doit(void) { int x __attribute__((cleanup (xyzzy))); } /* { dg-final { scan-assembler-not "xyzzy" } } */
google
chromium
pragmaweak1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/pragmaweak1.C
138
utf_8
ad117686eb16e680b29f2f5e45ebe0df
// PR c++/25999 // { dg-final { scan-assembler-not "_Z3Foov" } } extern "C" { void Foo(); } #pragma weak Random_Symbol void Foo() { }
google
chromium
case-range2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/case-range2.C
643
utf_8
6d2f84a379ba22c5f6c546f90bbda615
// { dg-do compile } // Tests if case ranges (a GNU extension) correctly emit messages // about overlapping ranges. // { dg-options "" } const int low = -2; const int high = 15; template <typename T> T f2 (T i) { switch (i) { case low ... high : return i + 1; // { dg-error "previously" } case 5 : return ...
google
chromium
vector2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/vector2.C
334
utf_8
3f2ba0450158ad5c221f98dd0e641cbf
// PR c++/23337; caused an ICE in component_ref_field_offset // { dg-options "" } // { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ typedef int vec __attribute__ ((vector_size (8))); extern int bar (vec); int foo (int i) { vec a[] = { (vec) { 0, i }, (vec) { 4, 5 } }; return bar (a[0]) + ...
google
chromium
altivec-cell-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-cell-1.C
1,476
utf_8
dd9c52efe2c8d9b6297333f40984600a
/* { dg-do compile { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec" } */ /* Basic test for the new VMX intrinsics. */ #include <altivec.h> int f(vector int a, int b) { return vec_extract (a, b); } short f1(vector short a, int b) { return vec_extrac...
google
chromium
cleanup-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/cleanup-4.C
573
utf_8
95a700f1b361b8b7247dd036428905d7
/* { dg-do run } */ /* { dg-options "" } */ /* Verify cleanup execution on non-trivial exit from a block. */ extern "C" void exit(int); extern "C" void abort(void); static int counter; static void handler(int *p) { counter += *p; } static void __attribute__((noinline)) bar(void) { } static void doit(int n, int ...
google
chromium
attrib27
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib27.C
167
utf_8
2c1f177fcc72b3e947f945d29d8570e6
//PR c++/29980 struct A { typedef int X; }; // { dg-error "previous declaration" } struct __attribute__((unused)) A::X; // { dg-error "typedef-name" }
google
chromium
altivec-16
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-16.C
378
utf_8
1f347fa1c57370132e750e4fb8b77f9d
// PR c++/36662 // { dg-do compile { target powerpc*-*-* } } // { dg-require-effective-target powerpc_altivec_ok } // { dg-options "-maltivec" } #define vector __attribute__((altivec (vector__))) template <typename c> struct S {}; template <> struct S<vector float> { static vector float zero; }; template <int> vo...
google
chromium
attrib12
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/attrib12.C
222
utf_8
c460ffd02f4c4ad800649b58a60f30e1
// PR c++/13791 template <typename T> struct O { struct __attribute__((packed)) I { int i; char c; }; I* foo(); }; template <typename T> typename O<T>::I* O<T>::foo() { return 0; } template class O<int>;
google
chromium
is_pod
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/is_pod.C
1,121
utf_8
a7f24c72c3a372a243466cb833a3b8e0
// { dg-do "run" } #include <cassert> struct A { double a; double b; }; struct B { B() { } }; struct C : public A { }; template<typename T> bool f() { return __is_pod(T); } template<typename T> class My { public: bool f() { return !!__is_pod(T); } }; template<typename T> class My2 {...
google
chromium
complex4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/complex4.C
199
utf_8
35b7aa6c0d6fc7e40536c9546a810234
// { dg-do compile } // This code used to be rejected as there was no conversion from int to float __complex__ #include <vector> typedef float __complex__ fcomplex; std::vector<fcomplex> vfc(10);
google
chromium
asmspecInvalid
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/asmspecInvalid.C
534
utf_8
81d7f5132402c3b9c67ba05f4d092697
// tests that the asm directive is correctly handled for static fields // in structures and classes. This only applies to C++; such // directives generate errors in C. Assembler directives for local // variables should be tested by the C test suite. // // { dg-do compile } struct Foo { // This should reference a ...
google
chromium
packed8
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/packed8.C
535
utf_8
9cc672b535d8f71fe730d74c00807d76
// PR c++/18378 // NOTE: This test assumes packed structure layout differs from unpacked // structure layout. This isn't true, e.g., with the default // arm-none-elf options. // { dg-options "-mstructure-size-boundary=8" { target arm-*-* } } class A { public: int i; A() {} A(const A& a) { i = a.i; ...
google
chromium
align2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/align2.C
251
utf_8
9b72806f0ff8dd6bff6e2ef84f0ce102
// PR c++/10179 struct __attribute((aligned(__alignof(double)))) A { /* empty */ }; struct T : public A { char c; }; template<bool> struct StaticAssert; template<> struct StaticAssert<true> {}; StaticAssert<__alignof(T) == __alignof(double)> d;
google
chromium
altivec-cell-5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-cell-5.C
1,368
utf_8
29cab7a77633102be8f79fea8bd692b1
/* { dg-do compile { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec" } */ /* Basic test for the new VMX intrinsics and error messages. */ #include <altivec.h> int main(int argc, char **argv) { vector float t; vec_promote(); /* {...
google
chromium
utf-badconcat
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/utf-badconcat.C
921
utf_8
3e8f2dc091110c881df8e144f0891477
/* Test unsupported concatenation of char16_t/char32_t* string literals. */ /* { dg-do compile } */ /* { dg-options "-std=c++0x" } */ const void *s0 = u"a" "b"; const void *s1 = "a" u"b"; const void *s2 = u"a" U"b"; /* { dg-error "non-standard concatenation" } */ const void *s3 = U"a" u"b"; /* { dg-error "non-standar...
google
chromium
altivec-cell-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-cell-3.C
841
utf_8
141d17972ddb9632037c663fb3999e80
/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */ /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec" } */ /* Test the vec_splats and vec_promote VMX intrinsics. */ #include <altivec.h> extern "C" void abo...
google
chromium
has_trivial_destructor-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_trivial_destructor-2.C
83
utf_8
a24f991beb2c5296f2e8144630b7bb1a
// PR c++/36855 typedef char assert_0 [__has_trivial_destructor (int&) ? 1 : -1];
google
chromium
has_trivial_constructor
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/has_trivial_constructor.C
1,428
utf_8
cb205a1f764db064e154ba0edc92d4d4
// { dg-do "run" } #include <cassert> struct A { double a; double b; }; union U { double a; double b; }; struct B { B() { } }; struct C : public B { }; struct D : public A { }; struct E { A a; }; struct F { B b; }; template<typename T> bool f() { return __has_trivial_constructor(T); } template<t...
google
chromium
no-asm-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/no-asm-1.C
309
utf_8
d8aab6d07f244c4b9f78c15a01c07e27
// { dg-do compile } // { dg-options "" } // Verify that asm and the GNU extension typeof are recognized as // keywords. int asm; // { dg-error "before .asm." } int typeof; // { dg-error "expected" } // { dg-error "multiple types" "" { target *-*-* } 8 } // { dg-error "declaration" "" { target *-*-* } 8 }
google
chromium
interface1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/interface1.C
161
utf_8
3a16bb49d1e751989bc6c5980e68cc41
// PR c++/22252 // { dg-do link } // { dg-additional-sources "interface1a.cc" } // { dg-options "-fno-inline" } #pragma implementation #include "interface1.h"
google
chromium
altivec-types-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/ext/altivec-types-4.C
488
utf_8
0ba4e5317a039c3cdd18f9724f001f46
/* { dg-do compile { target powerpc*-*-linux* } } */ /* { dg-require-effective-target ilp32 } */ /* { dg-require-effective-target powerpc_altivec_ok } */ /* { dg-options "-maltivec -mno-warn-altivec-long" } */ /* These should not get warnings for 32-bit code when the warning is disabled. */ __vector long vl; __ve...