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
pr21983
.C
native_client/nacl-gcc/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
chromium
main-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/main-4.C
159
utf_8
b8c62de5dbf97777a789b0e6031264f5
// This pattern is used by a lot of autoconf scripts, so don't // complain about it unless -pedantic. // { dg-options "" } int main () { main (); return 0; }
google
chromium
Wreorder-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wreorder-1.C
204
utf_8
c581ab7bc1c10728c1e68266d06af6e9
// { dg-options "-Wreorder -W" } struct S { S (); }; struct T { T (); }; struct U : virtual public S, virtual public T { U () : T (), S () {} // { dg-warning "" } U (const U&) : S () {} };
google
chromium
miss-format-3
.C
native_client/nacl-gcc/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
chromium
do-empty
.C
native_client/nacl-gcc/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
chromium
noreturn-5
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/noreturn-5.C
274
utf_8
cdfdbc855eb8f2a2ccce7134c9da053f
// PR c++/30988 // { dg-do compile } // { dg-options "-O2 -Wall" } void f (const char *) __attribute__ ((noreturn)); void f (int) __attribute__ ((noreturn)); void f (double) __attribute__ ((noreturn)); template <typename T> struct A { int g () { f ((T) 0); } };
google
chromium
compare1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/compare1.C
246
utf_8
064f2d562e6ae3005fac3be98940a167
/* -Wall is supposed to trigger -Wsign-compare for C++. PR 10604. See also gcc.dg/compare7.c. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ int f(unsigned a, int b) { return a < b; /* { dg-warning "signed and unsigned" } */ }
google
chromium
Wconversion1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wconversion1.C
303
utf_8
d10152133e840d3699814c5271083357
// { dg-options "-fsigned-char -Wsign-conversion" } char c1 = 1024; // { dg-warning "overflow" } char c2 = char(1024); char c3 = (char) 1024; char c4 = static_cast<char>(1024); unsigned char uc1 = -129; // { dg-warning "unsigned" } bool b1 = -3; int i1 = 0x80000000; // { dg-warning "conversion" }
google
chromium
Weff1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Weff1.C
141
utf_8
6cbb434563bf5c0247156042fe84718d
// { dg-options "-Weffc++" } struct S {}; /* Base classes should have virtual destructors. */ struct T : public S {}; // { dg-warning "" }
google
chromium
effc3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/effc3.C
994
utf_8
a09300084b0484d20d1e01b50584cbd6
// { dg-do compile } // { dg-options "-Weffc++" } // Contributed by Benjamin Kosnik <bkoz at redhat dot com> // PR c++/16165 and PR c++/8211: Improve item 11 of -Weffc++ // We should not warn for this class since this kind of pointers can // never hold dynamic memory. struct A { void (*func1)(void); void (A::*fu...
google
chromium
Wdtor1
.C
native_client/nacl-gcc/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
chromium
pr35602
.C
native_client/nacl-gcc/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
chromium
Wuninitializable-member
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wuninitializable-member.C
362
utf_8
cb6b38abe346f8950bdb218ab4c6e17d
// { dg-do compile } // { dg-options "-Wuninitialized" } class X { int & flag;// { dg-warning "non-static reference 'int& X::flag' in class without a constructor" } public: void f(){ flag++ ; } }; class Y { const int var;// { dg-warning "non-static const member 'const int Y::var' in class without a constructor...
google
chromium
Wparentheses-22
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-22.C
2,119
utf_8
d18ff788cbb2084df4ebb3ddadb46dd8
// { dg-do compile } // { dg-options "-Wparentheses" } // Warnings for assignments used as truth-values when using classes. // Like Wparentheses-1.C, but with a class. int foo (int); class C { public: C() : b(0) { } // Use default assignment constructor. // Provide conversion to bool so that an instan...
google
chromium
overflow-warn-6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/overflow-warn-6.C
359
utf_8
e36e0e34c32010c5c54008377dce599e
/* Test non-constant operands in overflowed expressions. */ /* { dg-do compile } */ /* { dg-options "-Woverflow" } */ #include <limits.h> int h1 (int x) { return x * (0 * (INT_MAX + 1)); /* { dg-warning "integer overflow in expression" } */ } int h2 (int x) { return ((INT_MAX + 1) * 0) * x; /* { dg-warning "i...
google
chromium
Wstrict-aliasing-4
.C
native_client/nacl-gcc/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
chromium
noeffect8
.C
native_client/nacl-gcc/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
chromium
Wunreachable-code-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wunreachable-code-2.C
293
utf_8
aa9f0a4fa9133811690bf8fa76df33b7
// PR c++/21228 /* { dg-options "-Wunreachable-code" } */ class testStringBase { public: char *stringPtr; }; class testString : public testStringBase { public: testString(); }; testString::testString() { stringPtr = (char *) 9; } int main(int argc, char **argv) { testString s; }
google
chromium
pr5645
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr5645.C
468
utf_8
6421a1ed78a5d7624b4d5f88e8d92add
// PR5645: gcc warns that pure virtual class not explicitly initialized. // { dg-do compile } // { dg-options "-Wall -Wextra" } class a { public: virtual int f() = 0; virtual int g() = 0; }; class b : public a { public: b(); b(const b& c); protected: int i; }; b::b() {} b::b(const b& c) { // { dg-bogus...
google
chromium
Wstrict-aliasing-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C
333
utf_8
b3735a938e1a49d3bef2fa33d5905d04
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ double x; template <typename T> T *foo(void) { return (T *)&x; /* { dg-warning "strict-aliasing" } */ } template int *foo<int>(void); /* { dg-message "instantiated from here" } */ template char *foo<char>(void); /* { dg-bogus "instantiated from...
google
chromium
Wctor-dtor
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wctor-dtor.C
227
utf_8
2d2da24222711602624d6870a966c8b0
// PR c++/21347 // { dg-options "-Wctor-dtor-privacy" } class A { public: int x; int getX() { return x; } // comment out to avoid warning }; int foo() { A a; // accepted: clearly the ctor is not private return a.x; }
google
chromium
Wparentheses-9
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-9.C
4,163
utf_8
6ac2e35b5e4a2de47ad29a14a6dbe103
// { dg-do compile } // { dg-options "-Wparentheses" } // C++ version of gcc.dg/Wparentheses-6.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
Wsign-compare-2
.C
native_client/nacl-gcc/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
chromium
Wswitch-default-1
.C
native_client/nacl-gcc/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
chromium
pr5310
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr5310.C
200
utf_8
89c64e7b581401ee2f6738f0d18e7483
// PR 5310 // { dg-do compile } // { dg-options "-pedantic -Wall -Wextra -Wpointer-arith -Wconversion" } void foo (int); void foo (long); void bar() { foo ((int)__null); foo ((long)__null); }
google
chromium
noeffect2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/noeffect2.C
700
utf_8
ddc9b2fcd58aa6e2e3d1775009375e12
// { dg-do compile } // { dg-options "-Wall" } // PR 11945 inconsistent warnings extern "C" void FormatDisk(); template <class T> struct C { C(){ FormatDisk(), 0; } // { dg-warning "right-hand operand of comma" "" } }; template struct C<int>; // { dg-message "instantiated" } template <class T> void f()...
google
chromium
Wparentheses-3
.C
native_client/nacl-gcc/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
chromium
Wconversion3
.C
native_client/nacl-gcc/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
chromium
changes-meaning
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/changes-meaning.C
246
utf_8
9d482788ebfbc6a8f5bfebe98d71ae94
/* { dg-do compile } */ /* { dg-options "-fpermissive" } */ template <class _Tp> class auto_ptr {}; /* { dg-warning "changes meaning" } */ template <class _Tp> class counted_ptr { public: auto_ptr<_Tp> auto_ptr(); /* { dg-warning "" } */ };
google
chromium
anonymous-namespace-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/anonymous-namespace-1.C
397
utf_8
b718de980adb60556e7ed2d1500c1178
// Test for the warning of exposing types from an anonymous namespace // { dg-do compile } #include "anonymous-namespace-1.h" namespace { class good { }; } class foo::bar : public good { }; class foobar1 { good g; }; #line 17 "foo.C" class foobar : public bad { }; // { dg-warning "uses the anonymous namespace" ...
google
chromium
Wparentheses-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-4.C
353
utf_8
5cb9671988084dbee7c5cdf77fbbfa0c
// Test that -Wparentheses does not give bogus warnings in the // presence of templates for non-plain assignment. Bug 17120. // { dg-do compile } // { dg-options "-Wparentheses" } template<typename _Tp> inline _Tp cmath_power(_Tp __x, unsigned int __n) { while (__n >>= 1) ; return __x; } int m...
google
chromium
Wsign-compare-1
.C
native_client/nacl-gcc/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
chromium
Wunreachable-code-1
.C
native_client/nacl-gcc/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
chromium
return-reference
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/return-reference.C
296
utf_8
70f8973f83c648dfef793b81d7b5a128
// { dg-do compile } const int* bar(); const int& foo1() { static int empty; const int* x = bar(); return (x ? *x : empty); // { dg-bogus ".*" "" { xfail *-*-* } } } const int& foo2() { static int empty; const int* x = bar(); const int& r = (x ? *x : empty); return (r); }
google
chromium
Wtype-limits-no
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wtype-limits-no.C
3,164
utf_8
d803f73370f8916f5ec2a47e528fa49a
/* Test disabling -Wtype-limits. */ /* { dg-do compile } */ /* { dg-options "-Wextra -Wno-type-limits" } */ extern void assert (int); void a (unsigned char x) { if (x < 0) return;/* { dg-bogus "comparison is always false due to limited range of data type" } */ if (x >= 0) return;/* { dg-bogus "comparison is alwa...
google
chromium
ctor-dtor-privacy-2
.C
native_client/nacl-gcc/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
chromium
empty-body
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/empty-body.C
364
utf_8
9362e9b4176e1dea1998f49b49d8bbcc
// PR c++/5520 // { dg-options "-O2 -Wempty-body" } void breakme() { if(1) ; // { dg-warning "empty body" } if(1) {} // { dg-bogus "empty body" } if(1) (void)0; // { dg-bogus "empty body" } if(1) {} else; // { dg-warning "empty body" } if(1) {} else (void)0; // // { dg-bogus "empty body" } if(1) ; else...
google
chromium
missing-field-init-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/missing-field-init-1.C
402
utf_8
67d018f4028bfdad4712e6c50a3eefa7
/* { dg-do compile } */ /* { dg-options "-Wextra -Wno-missing-field-initializers" } */ struct s { int a, b, c; }; struct s s1 = { 1, 2, 3 }; struct s s2 = { 1, 2 }; /* { dg-bogus "missing initializer" } */ struct s s3[] = { { 1, 2 }, { 4, 5 } }; /* { dg-bogus "missing initializer" } */ struct s s4[] = { 1, 2, 3, 4, 5 ...
google
chromium
noeffect7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/noeffect7.C
309
utf_8
165e60b3a0c53a0c1e6a87c65f59860e
// PR c++/8057 // Don't give a "statement has no effect" warning when declaring a // template, only when instantiating it. // { dg-do compile } // { dg-options "-Wunused" } struct Y { static int i; }; template <typename T> class X { X() { Y::i; }; }; class Z { Z() { Y::i; }; }; // { dg-warning "no effect" }
google
chromium
private1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/private1.C
213
utf_8
8c096cfbcb0f16fa5bde02650ac4ab41
// g++ should not complain about A having private [cd]tors. class A { A(); ~A(); public: int dummy(); // needed to get bogus warning static A* get_A (); }; A* A::get_A() { static A a; return &a; }
google
chromium
Wmissing-declarations-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wmissing-declarations-1.C
658
utf_8
d3017d025f43f9093bf016847e418a34
// { dg-options "-Wmissing-declarations" } void fn1() { } // { dg-warning "no previous declaration" } namespace ns { void fn2() { } // { dg-warning "no previous declaration" } } namespace { void fn3() { } } static void fn4() { } void fn5(); namespace ns { void fn6(); } void fn5() { } namespace ns { void fn6...
google
chromium
multiple-overflow-warn-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-2.C
363
utf_8
5a5d76c338de16945c65cd2aa45bfef0
/* PR c/19978 : Test for duplicated warnings (binary operators). */ /* { dg-do compile } */ /* { dg-options "-Woverflow" } */ #include <limits.h> int g1 (void) { return INT_MAX + 1 - INT_MAX; /* { dg-bogus "integer overflow in expression.*integer overflow in expression" } */ /* { dg-warning "integer overflow in...
google
chromium
Wnvdtor-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wnvdtor-2.C
935
utf_8
e5ddbe9f88e16de304b8fb39e7eb35af
// 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 { // { dg-bogus "non-v...
google
chromium
noreturn-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/noreturn-2.C
94
utf_8
10a2dc88ff4acf5169ed37d5b483050b
// { dg-options "-Wall" } template <class T> int f (T t) { } // { dg-warning "no return" }
google
chromium
Wunused-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-2.C
174
utf_8
61051d6055a088efd9b196d7533030ea
// { dg-do compile } // { dg-options "-Wunused -O3" } static const int i = 0; static void f() { } /* { dg-warning "defined but not used" "" } */ static inline void g() { }
google
chromium
Woverflow-2
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-7.C
366
utf_8
de6922f52681362a988b2a9e27c6e865
/* { dg-do compile } */ /* { dg-options "-Wstrict-aliasing=2 -O2" } */ 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 *)&__imag_...
google
chromium
overflow-warn-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
4,555
utf_8
a14024f8c187790a13607fe4f2439552
/* { dg-do compile } */ /* { dg-options "-fpermissive -pedantic" } */ #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: divi...
google
chromium
volatile1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/volatile1.C
174
utf_8
5cc9f29112baf492791a6e061240f16e
// PR c++/26577 struct A { A(const A&); A& operator=(const A&); void baz() volatile; }; void A::baz() volatile { *this; // { dg-warning "will not be accessed" } }
google
chromium
Wstring-literal-comparison-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstring-literal-comparison-4.C
336
utf_8
839fdbb04e93708d893f0f0e3f961ef5
/* PR c/7776 */ /* { dg-do compile } */ /* { dg-options "-Wall -Wno-address" } */ int test1(char *ptr) { return ptr == "foo"; } int test2() { return "foo" != (const char*)0; } int test3() { return "foo" == (const char*)0; } int test4() { return (const char*)0 != "foo"; } int test5() { return (const char*...
google
chromium
pragma-system_header2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pragma-system_header2.C
329
utf_8
9bcc53cc5dde27e75ab5715ac9f3c8aa
// PR c++/30500 // { dg-options "-Wconversion" } #include "pragma-system_header2.h" void f() { g<int>(); h<int>(); } // { dg-warning "conversion" "" { target *-*-* } 2 } // { dg-warning "conversion" "" { target *-*-* } 5 } // I couldn't find another way to make this work. // { dg-prune-output "In file included...
google
chromium
Wshadow-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wshadow-4.C
703
utf_8
cb568c46e03078f29a2040ab53ab0387
// PR c++/39526 // { dg-options "-Wshadow" } class INetURLObject { public: INetURLObject(int i); int GetMainURL() const; }; int foo(int infoo) // { dg-warning "shadowed declaration" } { int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" } extern void f(int infoo); struct A { ...
google
chromium
Wparentheses-25
.C
native_client/nacl-gcc/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
chromium
missing-field-init-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/missing-field-init-2.C
469
utf_8
5810653b0c8f7de9557f67564c81fa60
/* { dg-do compile } */ /* { dg-options "-Wmissing-field-initializers" } */ struct s { int a, b, c; }; struct s s1 = { 1, 2, 3 }; struct s s2 = { 1, 2 }; /* { dg-warning "(missing initializer)|(near initialization)" } */ struct s s3[] = { { 1, 2 }, { 4, 5 } }; /* { dg-warning "(missing initializer)|(near initializatio...
google
chromium
format4
.C
native_client/nacl-gcc/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
chromium
pr33160
.C
native_client/nacl-gcc/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
chromium
Wnvdtor
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wnvdtor.C
118
utf_8
17ce52166f1ac71872bcacc58c562353
// { dg-options "-Wnon-virtual-dtor" } extern "Java" { class Foo { public: virtual void bar( void); }; }
google
chromium
pr35635
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr35635.C
3,263
utf_8
ab2522c9f88b8ca84af673f1f53b5c2f
/* 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
chromium
Wunused-5
.C
native_client/nacl-gcc/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
chromium
Wswitch-default-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wswitch-default-2.C
267
utf_8
2908bb9b9b3a7ea3f41f0effd0934ce0
// PR C++/21123 /* { dg-do compile } */ /* { dg-options "-Wswitch-default" } */ template <typename ArrayType> void foo( ) { int i = 0; switch ( i ) /* { dg-warning "switch missing default case" } */ { case 9: break; } } void f() { foo<int>(); }
google
chromium
Wunused-7
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wunused-7.C
163
utf_8
c969e351f86316e8ad9196c0ce95cd3c
// PR c++/14481 // { dg-options "-Wunused" } void func() { struct mybitfields { unsigned int s_field:8; }; struct mybitfields s; s.s_field = 255; };
google
chromium
Wconversion-integer
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wconversion-integer.C
3,114
utf_8
2087b0b8d0d8185a0532862748386767
/* Test for diagnostics for implicit conversions between integer types C++ equivalent of gcc/testsuite/gcc.dg/Wconversion-integer.c */ // { dg-do compile } // { dg-options "-fsigned-char -Wconversion" } #include <limits.h> void fsc (signed char sc); void fuc (unsigned char uc); unsigned fui (unsigned int ui);...
google
chromium
nonnull1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/nonnull1.C
430
utf_8
40efbe938691eeff621e7ef02235827f
// Test that "nonnull" attribute works for C++. // { dg-do compile } // { dg-options "-Wall" } // The "nonnull" attribute is thoroughly tested for C, so here we // simply test that it works at all, as at one point the relevant // checking code was only called for C. extern void f (char *) __attribute__((nonnull)); void...
google
chromium
Wsequence-point-pr18050
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wsequence-point-pr18050.C
414
utf_8
8fb4b9a6c1d26c1e9bde7782d85ab4db
/* PR 18050 : bogus warning with -Wsequence-point */ /* { dg-do compile } */ /* { dg-options "-Wsequence-point" } */ struct x { int i; }; void bar(struct x*, int *); void foo(struct x *y) { bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */ } void zz(int a, int *b) { *b = a; } void baz(...
google
chromium
Wconversion2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wconversion2.C
132
utf_8
f4ec0cfd531d7446511e8f16049b47e1
// { dg-options "-Wconversion" } void foo(const char *); void bar() { foo(false); } // { dg-warning "pointer type for argument" }
google
chromium
Wchar-subscripts-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wchar-subscripts-2.C
235
utf_8
d15107f3d840c1f7539a3dc2f640a5df
/* PR c++/16307 */ // { dg-do compile } // { dg-options "-Wchar-subscripts" } extern volatile char bla; char foo (const char *s) { return s [bla]; // { dg-warning "array subscript" } } int main () { foo ("\x80"); }
google
chromium
Wunused-11
.C
native_client/nacl-gcc/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
chromium
write-strings-default
.C
native_client/nacl-gcc/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
chromium
var-args1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/var-args1.C
169
utf_8
aee910320aa561272260bfc2fcc381f9
/* { dg-do compile } */ #include <stdarg.h> void foo(int, ...) { va_list va; int i; i = va_arg(va, int&); /* { dg-warning "cannot receive objects" } */ }
google
chromium
pr8570
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr8570.C
334
utf_8
8e67188b7bdbe0df3618b69da33f302a
// PR c++/8570 // { dg-do compile } // { dg-options "" } template <typename T, typename P> class X { // { dg-message "note: previous declaration .* used 2" } public: X() { } private: template <typename U> friend class X; // { dg-error "redeclared with 1 template parameter" } }; X<int, int> i; // { dg-message "in...
google
chromium
Wextra-2
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-bogus-const
.C
native_client/nacl-gcc/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
chromium
Wparentheses-5
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-bogus-struct-included
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C
269
utf_8
73aa8fdd361564d9ba904d4252613717
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ struct S { int i; float f; }; int foo () { struct S s; s.i = 7; float* f = &s.f; /* { dg-bogus "float included in struct S" } */ *f = 2.0; return s.i + (int)s.f; }
google
chromium
Wenum-compare
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wenum-compare.C
237
utf_8
37c21b63185cc6eb45eceb0b75e600a3
/* Test that we get the -Wenum-compare by default. See PR27975. */ /* { dg-do compile } */ /* { dg-options "" } */ enum E1 { a }; enum E2 { b }; int foo (E1 e1, E2 e2) { return e1 == e2; /* { dg-warning "comparison between" } */ }
google
chromium
unit-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/unit-1.C
210
utf_8
6d4a9123531aa6035c839c056617799a
/* { dg-do compile } */ /* { dg-options "-O2 -Wuninitialized" } */ struct a { int mode; }; int sys_msgctl (void) { struct a setbuf; /* { dg-warning "'setbuf\.a::mode' is used" } */ return setbuf.mode; }
google
chromium
miss-format-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/miss-format-1.C
1,111
utf_8
07fe4fb2b51d4221c1df7237e70070f8
/* { dg-do compile } */ /* { dg-options "-Wmissing-format-attribute" } */ /* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */ /* VxWorks does not provide vscanf, either in kernel or RTP mode. */ /* { dg-error "not declared" "" { target *-*-solaris2.[7-8] *-*-vxworks* } 25 } */ #include <stdi...
google
chromium
Wparentheses-24
.C
native_client/nacl-gcc/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
chromium
Woverloaded-1
.C
native_client/nacl-gcc/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
chromium
Wreturn-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-2.C
118
utf_8
6a9ad99dea244e7a1d6655a1e95ccfea
// { dg-do compile } int foo(int first) { while (true) { return first; } } // { dg-bogus "control reaches" }
google
chromium
pr30551-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/pr30551-2.C
361
utf_8
eb7f623d124b0bcc1f9722099c010844
// 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." } */ /* { dg-error "main.* takes only zero or tw...
google
chromium
huge-val1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/huge-val1.C
623
utf_8
e81d20f2a65cb672129118ceab24cd3e
// PR c++/23139: HUGE_VAL definition should be accepted with -pedantic. // { dg-do link } // { dg-options "-pedantic-errors" } #include <math.h> double d = HUGE_VAL; #ifdef HUGE_VALF float f = HUGE_VALF; #endif #ifdef HUGE_VALL long double l = HUGE_VALL; #endif extern void link_failure (); int main () { #ifdef __GLIBC_...
google
chromium
Wreturn-type-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wreturn-type-1.C
123
utf_8
784c916e3f956afe80f26ff565b29be6
// PR c++/11725 // { dg-options "-Wreturn-type" } template <class T> struct A { int foo() { throw "Stop"; } };
google
chromium
pr11159
.C
native_client/nacl-gcc/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
chromium
noreturn-6
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/noreturn-6.C
240
utf_8
c5311890f0c28242d0882ede510185e1
// PR c++/30988 // { dg-do compile } // { dg-options "-O2 -Wall" } void f (const char *); template <typename T> struct A { int g () { f (__FUNCTION__); } // { dg-warning "no return statement in function returning non-void" } };
google
chromium
noreturn-7
.C
native_client/nacl-gcc/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
chromium
Wsign-conversion
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wsign-conversion.C
3,684
utf_8
b338731942d8716fd302c4acb247e53a
/* Test for diagnostics for implicit conversions between signed and unsigned integer types. C++ equivalent of gcc/testsuite/gcc.dg/Wsign-conversion.c */ // { dg-do compile } // { dg-options "-fsigned-char -Wsign-conversion" } #include <limits.h> void fsc (signed char sc); void fuc (unsigned char uc); unsigne...
google
chromium
pedantic1
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-5
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-bogus-placement-new
.C
native_client/nacl-gcc/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
chromium
Wstring-literal-comparison-1
.C
native_client/nacl-gcc/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
chromium
deprecated-2
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/deprecated-2.C
305
utf_8
26bafcbe2a9f3729e0b0e2ff8ccf5317
/* Test __attribute__((deprecated)). Test merging with multiple declarations. Bug 7425 (C++ version). */ /* { dg-do compile } */ /* { dg-options "" } */ void func(void); void func(void) __attribute__((deprecated)); void f(void) { func(); /* { dg-warning "'void func\\(\\)' is deprecated" } */ }
google
chromium
Wunused-4
.C
native_client/nacl-gcc/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
chromium
Wparentheses-1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wparentheses-1.C
1,661
utf_8
d1f22f759809f81b1b677be34f938b02
// Test operation of -Wparentheses. Warnings for assignments used as // truth-values. Essentially the same as gcc.dg/Wparentheses-3.c. // { dg-do compile } // { dg-options "-Wparentheses" } int foo (int); int a, b, c; bool d; void bar (void) { if (a = b) // { dg-warning "assignment" "correct warning" } foo (0);...
google
chromium
new1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/new1.C
50
utf_8
f90f92d0ee11df948b19aaef9ca54cd1
void f() { new int[0]; // { dg-bogus "zero" } }
google
chromium
register-var-2
.C
native_client/nacl-gcc/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
chromium
Wstrict-aliasing-bogus-escape-3
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-escape-3.C
386
utf_8
ef9cbc9a3736627428296e32dffe78fd
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing" } */ struct Node_base {}; struct Node : Node_base { int data; }; struct List { Node_base node, *prev; List() : prev(&node) { xyz(); } void xyz(); int back() { return static_cast<Node*>(prev)->data; } }; struct A { virtual ~A(); }; A* fo...
google
chromium
Wenum-compare-no
.C
native_client/nacl-gcc/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
chromium
format1
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/format1.C
471
utf_8
931d147f4baed695f1a67ae899cebd03
// Test that formats get checked according to C94. // { dg-do compile } // { dg-options "-ansi -pedantic -Wformat" } #include <cstdio> void foo (int i, int *ip, __WINT_TYPE__ lc, wchar_t *ls) { std::printf ("%d%ls%lc\n", i, ls, lc); std::printf ("%d", ls); // { dg-warning "format" "printf warning" } std::scanf ("...
google
chromium
overflow-warn-4
.C
native_client/nacl-gcc/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
4,544
utf_8
4aa78519246c6b2b640070e4fd79e697
/* { 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...