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 | new1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/new1.C | 50 | utf_8 | f90f92d0ee11df948b19aaef9ca54cd1 | void f() {
new int[0]; // { dg-bogus "zero" }
}
|
google | android | Wconversion-integer | .C | toolchain/gcc/gcc-4.9/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 | android | Wsign-compare-5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsign-compare-5.C | 470 | utf_8 | 6773c9e70593e16deba6bbd42d8e2ccc | // Test that -Wsign-compare doesn't warn about
// equality/non-equality comparisons with sizeof.
// { dg-do compile }
// { dg-options "-Wsign-compare" }
int
foo (int x)
{
if (x != sizeof (sizeof (x))) // { dg-bogus "comparison between signed and unsigned integer expressions" }
return 1;
return 0;
}
int
bar (... |
google | android | Wunused-parm-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-parm-3.C | 914 | utf_8 | e2b1e313bf63113458031cd03d300763 | // { dg-do compile }
// { dg-options "-Wunused -W" }
// Suppress a warning that is irrelevant to the purpose of this test.
// { dg-options "-Wunused -W -Wno-abi" { target arm_eabi } }
#include <stdarg.h>
struct A
{
long a;
A () : a (0) { }
A (long x) : a (x) { }
operator long () const { return a; }
long ope... |
google | android | Wself-assign-5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-5.C | 665 | utf_8 | 2c6333ce96286cb100464d409678d43e | // Test -Wself-assign does not warn on self-assignment of non-POD variables.
// { dg-do compile }
// { dg-options "-Wself-assign" }
template<typename T>
class Foo {
private:
T a_;
public:
Foo() : a_(a_) {} // { dg-warning "assigned to itself" }
void Set() { a_ = a_; }
};
struct Bar {
int b_;
int c_;
vo... |
google | android | Wself-assign-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-4.C | 973 | utf_8 | ed64f4a6c46b44b4b4e77d7f5de2b62a | // Test how self-assignment detection handles constant-folding happening
// when parsing the RHS or the initializer.
// { dg-do compile }
// { dg-options "-Wself-assign" }
class Foo {
private:
int a_;
public:
Foo() : a_(a_+0) {} // should not warn
void setA(int a) {
a_ = a_ + 0; // should not warn
}
... |
google | android | empty-body | .C | toolchain/gcc/gcc-4.9/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 | android | Wparentheses-4 | .C | toolchain/gcc/gcc-4.9/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 | android | pr5310 | .C | toolchain/gcc/gcc-4.9/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 | android | Wstrict-aliasing-bogus-union | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-union.C | 241 | utf_8 | 81024e5e796ea1637204d6a421f3c1bb | /* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
union U {
int i;
float f;
};
float foo () {
union U u;
float* f = &u.f; /* { dg-bogus "unions are holy in GCC" } */
u.i = 2;
return *f;
}
|
google | android | Wparentheses-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-2.C | 734 | utf_8 | ea3c2716291fc812b8d00190b207f31b | // Test operation of -Wparentheses. Warnings for assignments used as
// truth-values shouldn't apply other than for plain assignment.
// Essentially the same as gcc.dg/Wparentheses-10.c.
// { dg-do compile }
// { dg-options "-Wparentheses" }
int foo (int);
int a, b, c;
bool d;
void
bar (void)
{
if (a += b)
foo (... |
google | android | pr28943 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr28943.C | 498 | utf_8 | a7158d5a1d0acfa018bf80fecfe8aa6e | // PR c++/28943 void and non-void in conditional expression
// { dg-do compile }
// { dg-options "" }
void debug (const char * string)
{
return;
}
int f()
{
( true == false ? 0 : debug ("Some string")); // { dg-error "third operand .* type 'void'.* second operand is neither a throw-expression nor of type 'void'" ... |
google | android | pragma-system_header2 | .C | toolchain/gcc/gcc-4.9/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 | android | Wunused-var-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-6.C | 288 | utf_8 | 87a6fe8bfeffa1f31aecfb6dc5c8fc8e | // { dg-do compile }
// { dg-options "-Wunused" }
template <int N>
int
f1 (void)
{
int c = ({
int a;
a = 1;
a; });
return c;
}
template <int N>
void
f2 (void)
{
int f;
f = 0;
__asm__ __volatile__ ("" : "+r" (f));
}
void
test ()
{
(void) f1<0> ();
f2<0> ();
}
|
google | android | deprecated-2 | .C | toolchain/gcc/gcc-4.9/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 | android | Wzero-as-null-pointer-constant-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C | 127 | utf_8 | 7a6d9ddc7bec58ecee07985fbaf4d573 | // PR c++/53301
// { dg-options "-Wzero-as-null-pointer-constant" }
class x { public: x(int v) {} };
void foo(const x& = 0);
|
google | android | Wunused-var-17 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-17.C | 127 | utf_8 | 26afd4814c461a850bb5b98f2faac581 | // PR c++/10416
// { dg-options "-Wunused" }
void f () { struct atend { ~atend () { __builtin_printf("leaving f\n"); } } a; }
|
google | android | Wcast-qual2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wcast-qual2.C | 98 | utf_8 | f50d5f5cee6b74c0a37e13edc9036b8a | // PR c++/50956
// { dg-options "-Wcast-qual" }
void* p = (void*)"txt"; // { dg-warning "cast" }
|
google | android | pragma-system_header4 | .C | toolchain/gcc/gcc-4.9/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 | android | multiple-overflow-warn-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/multiple-overflow-warn-1.C | 383 | utf_8 | 800f093369a20897b711a58085d70bcb | /* PR c/19978 : Test for duplicated warnings (unary operators). */
/* { dg-do compile } */
/* { dg-options "-Woverflow -ftrack-macro-expansion=0" } */
#include <limits.h>
int
g (void)
{
return - - - - -INT_MIN; /* { dg-bogus "integer overflow in expression.*integer overflow in expression" } */
/* { dg-warning "... |
google | android | Wsign-compare-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wsign-compare-4.C | 280 | utf_8 | 1a0990fdac63360397c6cb63b103ff19 | //PR c++/50012
// { dg-options "-Wsign-compare" }
int foo(unsigned int *a, int b)
{
return (*a) <= b; // { dg-warning "comparison between signed and unsigned" }
}
int bar(unsigned int *a, int b)
{
return *a <= b; // { dg-warning "comparison between signed and unsigned" }
}
|
google | android | Wnvdtor-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnvdtor-4.C | 926 | utf_8 | 42cdf56d135a68d4ae812e5c661edae8 | // { dg-do compile }
// { dg-options "-Weffc++ -Wno-non-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();
publ... |
google | android | effc1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wmissing-declarations-1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wunused-label-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-label-3.C | 660 | utf_8 | d5cff1ce2b6ee2338f66afe65583b24c | // { dg-do compile }
// { dg-options "-Wunused-label" }
extern void f9();
template<int i>
void
f1()
{
if (i)
return;
l1: f9(); // { dg-warning "not used" }
l3: ; f9(); // { dg-warning "not used" }
l4: __attribute__ ((unused)) ; f9();
}
template
void f1<0>();
template<int i>
void
f2()
{
if (i)
... |
google | android | anonymous-namespace-1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wdiv-by-zero-bogus-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wdiv-by-zero-bogus-2.C | 235 | utf_8 | bd11a2daa2d98e0a5e4ef883cd664911 | // PR c++/57132
template<unsigned m, unsigned a>
struct mod
{
static unsigned calc(unsigned x) {
unsigned res = a * x;
if (m)
res %= m;
return res;
}
};
int main()
{
mod<3,2>::calc(7);
mod<0,2>::calc(7);
}
|
google | android | huge-val1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wparentheses-9 | .C | toolchain/gcc/gcc-4.9/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 | android | format1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wreturn-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-3.C | 234 | utf_8 | d0e225992bc2f0e5e2e51d846e21a8b4 | // { dg-options "-Wreturn-type" }
// PR c++/20624
struct fpos {
fpos(int __pos) {}
};
struct g {
g();
~g();
};
fpos seekoff(int b, int c)
{
g __buf;
if (b != -1 && c >= 0)
return fpos(-1);
else
return fpos(-1);
}
|
google | android | Wconversion2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion2.C | 136 | utf_8 | eb03d456776d117ac6f7aeafe28787a4 | // { dg-options "-Wconversion-null" }
void foo(const char *);
void bar() { foo(false); } // { dg-warning "pointer type for argument" }
|
google | android | Wreturn-local-addr | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-local-addr.C | 417 | utf_8 | 87f8a33264631c1c4dfe8b26bd53d6d7 | // { dg-do assemble }
// { dg-options "-Werror=return-local-addr" }
// { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 }
int& bad1()
{
int x = 0; // { dg-error "reference to local variable" }
return x;
}
int* bad2()
{
int x = 0; // { dg-error "address of local variable" }
return ... |
google | android | Wunused-13 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-13.C | 201 | utf_8 | a1e8f0d7b53ea96c7283034075724914 | // Test whether -Wunused handles effectless indirect_ref operation ('*').
// { dg-do compile }
// { dg-options "-Wunused" }
void Foo(int* x) {
*x++; // { dg-warning "value computed is not used" }
}
|
google | android | noeffect7 | .C | toolchain/gcc/gcc-4.9/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 | android | ignored_typedef | .C | toolchain/gcc/gcc-4.9/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 | android | no-write-strings | .C | toolchain/gcc/gcc-4.9/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 | android | Wself-assign-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-1.C | 1,225 | utf_8 | 7726c3b2f9ddd338188c9000749d5901 | // Test the self-assignemnt detection and warning.
// { dg-do compile }
// { dg-options "-Wself-assign" }
class Foo {
private:
int a_;
public:
Foo() : a_(a_) {} // { dg-warning "assigned to itself" }
void setA(int a) {
a_ = a_; // { dg-warning "assigned to itself" }
}
void operator=(Foo& rhs) {
... |
google | android | friend | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/friend.C | 260 | utf_8 | 0163a6a329fdf7f5efa7b908b04848a0 | /* { dg-do compile } */
/* { dg-options -Wredundant-decls } */
/* Test to see if spurious warnings about redundant
declarations are emiited because of the friend
declaration. */
class Foo
{
friend void bar (Foo);
public:
};
extern void bar (Foo);
|
google | android | Wshadow-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-6.C | 1,261 | utf_8 | 54801a296e8d290329ff71ae79f67232 | // Test the declaration of nested lambda function shadows
// a parameter or previous local.
// { dg-do compile { target c++11 } }
// { dg-options "-Wshadow" }
struct S {};
int f1(int x) // { dg-message "shadowed declaration" }
{
int t = 0;
int m = 0; // { dg-message "shadowed declaration" }
[&t] (int x) { // ... |
google | android | Walways-true-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Walways-true-1.C | 1,434 | utf_8 | c93a1243159bc35416087275a8c45a38 | // 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 wa... |
google | android | Wreturn-type-1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wswitch-default-2 | .C | toolchain/gcc/gcc-4.9/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 | android | noreturn-5 | .C | toolchain/gcc/gcc-4.9/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 | android | main-4 | .C | toolchain/gcc/gcc-4.9/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 | android | Wstring-literal-comparison-4 | .C | toolchain/gcc/gcc-4.9/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 | android | ctor1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/ctor1.C | 165 | utf_8 | 450b64494a8df8181368be08d23e5bf9 | // PR c++/35734
// { dg-options "-W" }
struct A
{
A();
template<typename T> A(const T&);
};
struct B : A
{
B(const B&) {} // { dg-warning "base class" }
};
|
google | android | template-1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wstrict-aliasing-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-2.C | 215 | utf_8 | 414da1b51217d31e1c2f4c076e8fe650 | /* { dg-do compile } */
/* { dg-options "-Wstrict-aliasing=2 -O2" } */
double x;
template <typename T>
T *foo(void)
{
return (T *)&x; /* { dg-bogus "strict-aliasing" } */
}
template double *foo<double>(void);
|
google | android | Wunused-var-12 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-12.C | 417 | utf_8 | 0023541206b814fe5d60ed4865062f86 | // PR c++/44444
// { dg-do compile }
// { dg-options "-Wunused" }
struct S
{
const int &u;
const int &v;
S (const int &a, const int &b) : u(a), v(b) { }
};
bool
f1 ()
{
bool t = false;
S z = S (1, 2);
t |= z.u == 1;
t |= z.v == 2;
return t;
}
void
f2 ()
{
S z = S (1, 2);
z.u; // { dg-warning "no... |
google | android | Wstrict-aliasing-7 | .C | toolchain/gcc/gcc-4.9/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 | android | Wconversion-pr34389 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C | 1,074 | utf_8 | 2c4607ce27b629a3ea583bebe9da3a48 | /* PR 34389 */
/* { dg-do compile } */
/* { dg-options "-Wconversion -Wsign-conversion" } */
/* { dg-require-effective-target int32plus } */
short mask1(short x)
{
short y = 0x7fff;
return x & y; /* { dg-bogus "conversion" "bogus warning" } */
}
short mask2(short ssx)
{
short ssy;
short ssz;
ssz = ((int)s... |
google | android | Wunused-var-22 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-22.C | 169 | utf_8 | 5d6aae3538559dce1f197ff269ee52f8 | // PR c++/63657
// { dg-options "-Wunused-variable" }
class Bar
{
virtual ~Bar() {}
};
Bar& getbar();
void bar()
{
Bar& b = getbar(); // { dg-warning "unused" }
}
|
google | android | Wshadow-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-3.C | 110 | utf_8 | c6d10f027652eb4c20869c7eaeebb358 | // PR c++/18530
// { dg-options "-Wshadow" }
struct A {
A();
~A();
void foo (int __ct, int __dt) {}
};
|
google | android | Wunused-2 | .C | toolchain/gcc/gcc-4.9/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 | android | format6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/format6.C | 107 | utf_8 | 677e021d0f4c6a2c24627bc9093ea7d6 | // PR c++/17212
// { dg-options "-Wformat -Wno-format-zero-length" }
void f()
{
__builtin_printf("");
}
|
google | android | deprecated-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/deprecated-6.C | 5,294 | utf_8 | 9f3101ee1ded355e1947b609e4eb51a9 | /* Test __attribute__ ((deprecated("message"))) */
/* { dg-do compile } */
/* { dg-options "-Wdeprecated-declarations -fmessage-length=0" } */
typedef int INT1 __attribute__((deprecated("Please avoid INT1")));
typedef INT1 INT2 __attribute__ ((__deprecated__("Please avoid INT2")));
typedef INT1 INT1a; /* { dg-warn... |
google | android | pr5645 | .C | toolchain/gcc/gcc-4.9/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 | android | Wdiv-by-zero | .C | toolchain/gcc/gcc-4.9/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 | android | Wparentheses-20 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-20.C | 3,598 | utf_8 | 1fee47e73503ddfb98374f911b0e3801 | // { 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 | android | conversion-function-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/conversion-function-1.C | 183 | utf_8 | a13aaa30037789e1fbc1e83bdcbaff93 | // { dg-options "-Wno-conversion" }
struct A {
operator A&();
}; |
google | android | Wconversion1 | .C | toolchain/gcc/gcc-4.9/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 | android | Wreturn-2 | .C | toolchain/gcc/gcc-4.9/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 | android | pragma-system_header1 | .C | toolchain/gcc/gcc-4.9/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 | android | deprecated | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/deprecated.C | 3,818 | utf_8 | 966c33cf349322b3b99faf7895c5cca3 | /* Test __attribute__ ((deprecated)) */
/* { dg-do compile } */
/* { dg-options "-Wdeprecated-declarations -fmessage-length=0" } */
#if 1
typedef int INT1 __attribute__((deprecated));
typedef INT1 INT2 __attribute__ ((__deprecated__));
typedef INT1 INT1a; /* { dg-warning "'INT1' is deprecated" "" } */
typedef INT1... |
google | android | pr30551 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr30551.C | 332 | utf_8 | fd3d56857d4591f36f948f8ab29af289 | // 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." "int" } */
/* { dg-warning "main.* takes only zero or two arguments" "zero or two" { target *-*-... |
google | android | Wreturn-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-4.C | 962 | utf_8 | 2517f12853f6838edd913b1fa72b10a6 | // PR middle-end/51647
// { dg-do compile }
// { dg-options "-Wall" }
enum PropertyAttributes { NONE = 1 };
enum PropertyType { NORMAL = 0, FIELD = 1 };
class LookupResult;
template <typename T>
struct Handle
{
inline explicit Handle (T *obj) __attribute__ ((always_inline)) {}
inline T *operator-> () const __attr... |
google | android | Wstrict-aliasing-bogus-escape | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-escape.C | 330 | utf_8 | fd3e58149ce1fbe517a6bbeb205ae2d9 | /* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing" } */
#include <string>
#include <list>
class A;
class B {
public:
void foo(A&);
std::string s;
};
class A {
public:
A& qaz() {
l.push_back( new A() );
return *l.back();
}
std::list<A*> l;
};
void bar()
{
A a;
B b;
b.foo(a.q... |
google | android | Wparentheses-23 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-23.C | 2,365 | utf_8 | afd55c2d3666a85abefca5bb44baed64 | // { 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 | android | Wunused-var-8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-8.C | 434 | utf_8 | 12fcfa7c307d6c91a9038bade9f8e105 | // { dg-do compile }
// { dg-options "-Wunused" }
template <int N>
void
f1 (void)
{
extern int extvari;
extvari = 1;
}
int extvarj;
template <int N>
void
f2 (void)
{
extern int extvarj;
extvarj = 1;
}
static int extvark;
template <int N>
void
f3 (void)
{
extern int extvark;
extvark = 1;
}
template <in... |
google | android | anonymous-namespace-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/anonymous-namespace-3.C | 339 | utf_8 | 5fe87a6003dafa187a4c659e6b639f48 | // 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;
};
// { dg-prune-output "auto_ptr... |
google | android | Wconversion-real-integer2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-real-integer2.C | 1,205 | utf_8 | e4a0b3c73f0ebcf2f658f5e2249167b5 | /* { dg-do compile }
/* { dg-options "-Wconversion -ftrack-macro-expansion=2" } */
/* { dg-require-effective-target int32plus } */
// Before the fix that came with this test, we'd output an error for
// the __INT_MAX__ token. That token has a BUILTINS_LOCATION
// location, so the the location prefix in the warning me... |
google | android | Winline-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Winline-4.C | 486 | utf_8 | 401a1cfacaa701f3e1459d7dcaf225d9 | // { dg-do compile }
// { dg-options "-O2 -Winline" }
// Origin: <markus at oberhumer dot com>
// PR 17115: We should not emit -Winline warning for functions marked with
// noinline
struct Foo {
__attribute__((noinline)) int a(int r) { return r & 1; }
virtual __attribute__((noinline)) int b(int r) { return r & 1;... |
google | android | Wenum-compare | .C | toolchain/gcc/gcc-4.9/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 | android | Wunused-var-5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-var-5.C | 2,610 | utf_8 | d9191ea69f8ac18b1043d3d093b1f0d4 | // { dg-do compile }
// { dg-options "-Wunused" }
template <int N>
void
f1 (void)
{
int a; // { dg-warning "set but not used" }
int b;
int c;
c = 1;
a = b = c;
}
template <int N>
void
f2 (int x)
{
int a; // { dg-warning "set but not used" }
int b;
int c; // { dg-warning "set but not used" }
c = (a =... |
google | android | return-reference | .C | toolchain/gcc/gcc-4.9/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 | android | pr13358-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr13358-3.C | 625 | utf_8 | 5af7a1b2eded6ae8e6b38e3c1b5e15a6 | // 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" }
void use_longlong ()
{
unsigned long long x1, x2, x3;
// make sure it's ok with hex, decim... |
google | android | pr30636 | .C | toolchain/gcc/gcc-4.9/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 | android | Wself-assign-non-pod-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-1.C | 1,325 | utf_8 | 685854cfde406bb0c53f983f264e44f1 | // Test the self-assignemnt detection and warning.
// { dg-do compile }
// { dg-options "-Wself-assign -Wself-assign-non-pod" }
class Foo {
private:
int a_;
public:
Foo() : a_(a_) {} // { dg-warning "assigned to itself" }
void setA(int a) {
a_ = a_; // { dg-warning "assigned to itself" }
}
void oper... |
google | android | Wunused-local-typedefs-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-local-typedefs-3.C | 508 | utf_8 | 96299d5e038999c130b95569f8d19fd5 | /* Origin PR c++/54372
{ dg-options "-Wunused-local-typedefs" }
{ dg-do compile }
*/
template <typename T>
void f2()
{
typedef T t __attribute__((unused));
}
class S
{
template <typename T>
void f4()
{
typedef T t __attribute__((unused));
}
};
template <typename T>
class tS
{
void f... |
google | android | multiple-overflow-warn-2 | .C | toolchain/gcc/gcc-4.9/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 | android | Wreturn-type-8 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-type-8.C | 880 | utf_8 | ea532b8d02c84e413fb770ee0fdd34c7 | // PR c++/54046
// { dg-do compile }
// { dg-options "-O0 -Wall" }
void foo (void) __attribute__((noreturn));
struct A
{
~A () {}
};
bool
check1 (int x)
{
A z;
switch (x)
{
case 0:
return false;
default:
throw "X";
break;
}
}
bool
check2 (int x)
{
A z;
switch (x)
{
... |
google | android | Wno-return-local-addr | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wno-return-local-addr.C | 237 | utf_8 | 26f056d6de0144f7aed85c81b3e4f583 | // { dg-do assemble }
// { dg-options "-Wno-return-local-addr" }
int& bad1()
{
int x = 0;
return x;
}
int* bad2()
{
int x = 0;
return &x;
}
int f();
const int& bad3()
{
return f();
}
const int& bad4()
{
return int();
}
|
google | android | Wunused-parm-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-parm-2.C | 766 | utf_8 | b17926dc040110c67174d5c4203f7fee | // { dg-do compile }
// { dg-options "-Wunused -W" }
template <int N>
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];
}
template <int N>
in... |
google | android | private1 | .C | toolchain/gcc/gcc-4.9/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 | android | pr12242 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/pr12242.C | 1,464 | utf_8 | ea89985b833375f8baaf9c278fac3f65 | // PR 12242: should warn about out-of-range int->enum conversions
// { dg-do compile }
// { dg-options "-Wconversion -fpermissive" }
enum X { A };
enum Y { B, C, D };
void example ()
{
int i = 5;
X x;
Y y;
x = 10; // { dg-warning "invalid conversion from .int. to .X." "invalid" }
// { dg-warning ... |
google | android | Wself-assign-non-pod-4 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-4.C | 1,044 | utf_8 | e6309f136bc1d367e69735f5f255ec7f | // Test how self-assignment detection handles constant-folding happening
// when parsing the RHS or the initializer.
// { dg-do compile }
// { dg-options "-Wself-assign -Wself-assign-non-pod" }
class Foo {
private:
int a_;
public:
Foo() : a_(a_+0) {} // should not warn
void setA(int a) {
a_ = a_ + 0; // ... |
google | android | Wreturn-type-5 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wreturn-type-5.C | 240 | utf_8 | ac4f08dd2a157d7c72adbbb04354e082 | // PR c++/36254
// { dg-do compile }
// { dg-options "-Wreturn-type" }
int i, j, k;
struct X { X (); ~X (); };
bool
foo ()
{
X x;
if (i && j)
{
if (k)
return true;
else
return false;
}
else
return false;
}
|
google | android | noeffect2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/noeffect2.C | 677 | utf_8 | a4d808161ffb4c351d986f762323c400 | // { 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 operand of comma" "" }
};
template struct C<int>; // { dg-message "required" }
template <class T>
void f() { Format... |
google | android | noreturn-6 | .C | toolchain/gcc/gcc-4.9/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 | android | Wuseless-cast | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wuseless-cast.C | 3,346 | utf_8 | 88adcb759fca5a76baa049de4a8b2b25 | // { dg-options "-Wuseless-cast" }
template<typename T>
void tmpl_f1(T& t)
{
(int)(t);
static_cast<int>(t);
reinterpret_cast<int>(t);
(int*)(&t);
const_cast<int*>(&t);
static_cast<int*>(&t);
reinterpret_cast<int*>(&t);
(int&)(t);
const_cast<int&>(t);
static_cast<int&>(t);
... |
google | android | missing-field-init-2 | .C | toolchain/gcc/gcc-4.9/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 | android | Wnull-conversion-1 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C | 540 | utf_8 | e4b8d8ce7e2c0bf4436105a15a46de0f | // { dg-do compile }
// { dg-options "-Wconversion-null" }
#include <stddef.h>
void func1 (int *ptr);
void func2() {
int* t = false; // { dg-warning "converting 'false' to pointer" }
int* p;
p = false; // { dg-warning "converting 'false' to pointer" }
int* r = sizeof(char) / 2; ... |
google | android | Wall-write-strings | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wall-write-strings.C | 138 | utf_8 | 38c1d3bcd70aac8e2e1f0e19b075e6a9 | // PR 8586
// { dg-do compile }
// { dg-options "-Wall" }
char* foo = "foo"; // { dg-warning "" }
const char* bar = "bar";
|
google | android | effc3 | .C | toolchain/gcc/gcc-4.9/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 | android | Wself-assign-non-pod-3 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-3.C | 610 | utf_8 | ff8c86b422a9cc4d480cfd44a0e67972 | // Test how operands_equal_p handles a NULL operand.
// { dg-do compile }
// { dg-options "-Wself-assign -Wself-assign-non-pod" }
#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"); }
... |
google | android | Wunused-parm-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wunused-parm-6.C | 174 | utf_8 | 2449ef14ddff8722aafc96ac5e5e782b | // PR c++/61465
// { dg-do compile { target c++11 } }
// { dg-options "-Wunused-but-set-parameter" }
struct Foo {
Foo(void* x) : y{static_cast<char*>(x)} {}
char* y;
};
|
google | android | Wparentheses-7 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wparentheses-7.C | 2,882 | utf_8 | 6123d47b0c90e76bcd5c6a33cbd024bd | // { dg-do compile }
// { dg-options "-Wparentheses" }
// C++ copy of gcc.dg/Wparentheses-4.c
int foo (int);
int
bar (int a, int b, int c)
{
foo (a + b << c); // { dg-warning "parentheses" "correct warning" }
foo ((a + b) << c);
foo (a + (b << c));
foo (1 + 2 << c); // { dg-warning "parentheses" "correct war... |
google | android | miss-format-6 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/miss-format-6.C | 952 | utf_8 | aa07b1519cde34fc8f8e23f6aa2bb1ab | /* { dg-do compile } */
/* { dg-options "-Wmissing-format-attribute" } */
/* { dg-options "-Wmissing-format-attribute -Wno-abi" { target arm_eabi } } */
#include <stdarg.h>
typedef void (*noattr_t) (const char *, ...);
typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t;
typedef void (*vnoattr_t) (co... |
google | android | Wconversion-null-2 | .C | toolchain/gcc/gcc-4.9/gcc/testsuite/g++.dg/warn/Wconversion-null-2.C | 2,664 | utf_8 | a62c97169e0ae22bf0b06ddfa18a4a94 | // { dg-do link }
// { dg-options "" }
#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) {}
template <>
void l(long long) {}
void warn_for_NU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.