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 | crash2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash2.C | 170 | utf_8 | 763dc11e85b1839d0dbe23a9460bf2df | /* { dg-do compile } */
int main(void)
{
char x, y;
if ('A' == x) && ('B' == y)) { } /* { dg-error "" } */
if (x == 'A') && (y == 'B')) { } /* { dg-error "" } */
}
|
google | android | template10 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template10.C | 257 | utf_8 | e09de720f2c9e56b0965a0866614ebb9 | // PR c++/9486
// { dg-do compile }
template <typename> struct A
{
template <typename T> void foo(T);
};
template <typename T> void bar()
{
A<void>().template foo<T>(0);
}
template void bar<int>(); |
google | android | error8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error8.C | 384 | utf_8 | c8ad8b8d3fa554b37206f4fca5ac61f9 | // PR c++/13438
// { dg-options "-fshow-column" }
struct A { friend typename struct B; };
// { dg-error "28:expected nested-name-specifier before 'struct'" "expected" { target *-*-* } 4 }
// { dg-error "35:multiple types in one declaration" "multiple" { target *-*-* } 4 }
// { dg-error "12:friend declaration does n... |
google | android | error-column | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error-column.C | 188 | utf_8 | a64e620ac0df90a741fe0e470ee25a52 | // { dg-do compile }
// Make sure column information is correctly shown in error reporting
// { dg-options "-fshow-column" }
void foo ()
{
cout << "blah"; // { dg-error "3:'cout'" }
}
|
google | android | error22 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error22.C | 175 | utf_8 | cf81b63ad266926de254ac66a72d226f | // { dg-options "-fshow-column -ansi -pedantic-errors -Wno-long-long" }
// PR c++/15786
struct A {
void foo(bar* p); /* { dg-error "12:'bar' has not been declared" } */
};
|
google | android | defarg3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/defarg3.C | 87 | utf_8 | 09fddda5e825bb04b1493087728c9162 | struct A {
enum { value = 10 };
A() { f(); }
static int f(int i=value);
};
|
google | android | crash14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash14.C | 287 | utf_8 | 8fc5d6dab19b9f89401818b0138ffa98 | // { dg-do compile }
// Contributed by: Giovanni Bajo <giovannibajo at libero dot it>
// PR c++/14448: Fold constant initializers in templates
template <int> struct A
{
A();
};
template<typename T> void foo(T)
{
static const int n=1+1;
A<n+1> a;
}
void bar()
{
foo(0);
}
|
google | android | stack1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/stack1.C | 364 | utf_8 | 26b1b9df5ec9177a6c137833bf34a120 | /* PR c/2161: parser stack overflow. */
/* { dg-do compile } */
#define ONE else if (0) { }
#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
void foo()
{
if (0) { }
/* 11,000 else if's. */
THOU THOU THO... |
google | android | pr16696-permissive | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/pr16696-permissive.C | 376 | utf_8 | 9198d30497522f1d17ee58e2bce0c351 | // PR 16696 Strange message when operator++ not found
// { dg-do compile }
// { dg-options "-fdiagnostics-show-option -fpermissive" }
struct X { void operator++(); };
struct Y { };
int main () {
X x;
Y y;
x++; // { dg-warning "trying prefix operator" }
y++; // { dg-warning "trying prefix operator" }
... |
google | android | redef1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/redef1.C | 257 | utf_8 | 8d6d8891281e77e95edf66cda3bc270f | // { dg-options "" }
// PR c++/16193
# 1 "syshdr1.C"
# 1 "syshdr1.h" 1 3
// Redefinitions of built-in types are allowed in system headers so
// that G++ will work with system headers that are not fully
// C++-aware.
typedef long wchar_t;
# 2 "syshdr1.C" 2
|
google | android | pragma2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/pragma2.C | 293 | utf_8 | b8553036b01aadac9e932e75221336ae | // PR c++/17595
// Ideally, the #pragma error would come one line further down, but it
// does not.
int f(int x,
#pragma interface // { dg-error "not allowed here" }
// The parser gets confused and issues an error on the next line.
int y); // { dg-bogus "" "" { xfail *-*-* } }
|
google | android | dtor15 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/dtor15.C | 162 | utf_8 | 784814c1cb95ee4da37b2ff4009fc31b | // PR c++/39225
template <class T>
class A
{
public:
A() {}
~B() {} // { dg-error "~B" }
};
int main()
{
A<int> *a = new A<int>;
return 0;
}
|
google | android | operator1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/operator1.C | 176 | utf_8 | ca050d3a19382312a7cd864019542cf5 | /* PR c++/8982 */
/* { dg-do compile } */
namespace foo {
template<class X>
int operator- (X x);
}
int main() {
using foo::operator-; // syntax error under gcc 3.2
}
|
google | android | crash5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash5.C | 494 | utf_8 | a9f8d190eb216058f4bd38295b368246 | // { dg-options "-w" }
class QString { // { dg-error "previous definition" }
QString (const QString & a); // { dg-message "QString::QString|candidate expects" }
};
class QString { }; // { dg-error "redefinition" }
const QString q () {
QString z; // { dg-error "matching" }
// { dg-message "candidate" "candidate... |
google | android | else | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/else.C | 169 | utf_8 | c22d9f4a49cae5dbae1b167a7d5b6aa5 | // { dg-do compile }
// { dg-options " " }
int f()
{
if (1)
{
return 1;
else // { dg-error "expected .\}. before 'else'" }
{
return 0;
}
}
|
google | android | friend1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/friend1.C | 134 | utf_8 | 607c4c06d2daa0d87b677b1ad9fbc84b | namespace N {
template <typename T>
static void f ();
struct S {
friend void N::f<int> ();
static void f (int);
};
}
|
google | android | using4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/using4.C | 278 | utf_8 | 7bdf885c8575c5234e7e0016e3c76dcc | // PR c++/58457
struct allocator
{
void operator delete (void*);
void* operator new (__SIZE_TYPE__, void*);
};
struct type : public allocator
{
type() {}
using allocator::operator new;
using allocator::operator delete;
};
int main()
{
new (0) type;
return 0;
}
|
google | android | crash49 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash49.C | 174 | utf_8 | 2123894b81a9d793cebacb1e6af995a9 | // PR c++/37552
// { dg-do compile }
extern struct A a[1]; // { dg-error "forward declaration" }
void
foo ()
{
a[0]; // { dg-error "invalid use of incomplete type" }
}
|
google | android | crash11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash11.C | 670 | utf_8 | 4435ac4f24fa5731340d43e4ff33bb31 | // { dg-do compile }
// PR c++/5767: ICE parsing typename with invalid scope.
template <template <typename> class TP>
struct A
{
template <typename T>
struct Template
{
typedef typename TP<T>::Type Type;
};
};
template <template <typename> class TP>
struct B
{
template <typename T>
struct Template
{
... |
google | android | typedef3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/typedef3.C | 225 | utf_8 | 59fe1b0f374bc40069ca47d24584c60d | // PR c++/3004
// { dg-do compile }
struct A { typedef A* Ptr; }; // { dg-message "previous declaration" }
struct A::Ptr; // { dg-error "typedef|not declare anything" } |
google | android | crash42 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash42.C | 174 | utf_8 | aef7511bd3c7bf321e247bd64a72f884 | // { dg-do compile }
// { dg-options "-O2 -fprofile-arcs" }
// Origin: PR C++/36767
struct A { A (); ~A (); };
A a[2]; |
google | android | namespace-alias-1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/namespace-alias-1.C | 155 | utf_8 | 3c7eb55197b11b874fdd433f7c071163 | // PR c++/26155
namespace N
{
namespace M = N; // { dg-error "previous declaration" }
namespace M {} // { dg-error "declaration of namespace" }
}
|
google | android | pr37862 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/pr37862.C | 323 | utf_8 | a57434275b0ab07b7a1f918fef7791bc | // { dg-do run }
#include <stdlib.h>
class A {
public:
virtual void get (void) { }
};
class B : public A {
public:
void get (void) { abort (); }
};
class C : public B { };
int main (void)
{
C c;
C * p = &c;
p->A::get ();
(p->A::get) (); // The C++ parser used to resolve this to B::get()
return 0;... |
google | android | using3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/using3.C | 446 | utf_8 | ac80fae137a8a1ef9021d6e173ca8090 | // { dg-do compile }
// PR c++/11794. Using decl in nested classes of a template class
template <typename T> struct a
{
struct a1: T
{
using T::aa;
a1() { aa = 5; }
};
};
struct b { int aa; };
template <> struct a<int>::a1 { a1 () {} };
a<b>::a1 a_b;
a<int>::a1 a_i; |
google | android | specialization1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/specialization1.C | 290 | utf_8 | 26f42f00216f10d4e115c59c2cbbc006 | // PR c++/5723, PR c++/8522
// { dg-do compile }
template <typename T> class A;
template <typename T> class A<T>::B; // { dg-error "declaration" "err" }
// { dg-warning "declaration" "warn" { target *-*-* } 6 } |
google | android | dtor11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/dtor11.C | 155 | utf_8 | 9af20f2ed80bb687afac1f85d9e1dad4 | // PR c++/28606
// { dg-do compile }
struct A
{
~A A(); // { dg-error "destructor" }
};
struct B
{
A::~B B(); // { dg-error "as member of" }
};
|
google | android | error39 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error39.C | 174 | utf_8 | dd7c75650631a559c60b76902bb0f133 | // PR c++/41769
void f(void operator+()); // { dg-error "declaration" }
void g()
{
try
{
}
catch(void operator+()) // { dg-error "declaration" }
{
}
}
|
google | android | template6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template6.C | 405 | utf_8 | 36ce6bc0b81d40546501089e276c612d | // { dg-do compile }
// PR c++/9778. Ensure templated functions in other namespaces are
// correctly instantiated.
namespace NS {
template <int N> void foo ();
}
template <int N> struct X {
int m;
void g () {
NS::foo<sizeof(m)>();
}
};
template class X<2>; |
google | android | error27 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error27.C | 644 | utf_8 | 0bae3f809d6a77864d78201c7e784d4c | // { dg-options "-fshow-column -ansi -pedantic-errors -Wno-long-long" }
// PR c++/20152
struct KrSelectionMode { virtual void init() = 0; }; // { dg-error "8:previous definition of 'struct KrSelectionMode'" }
struct KrKDESelectionMode : public KrSelectionMode { void init() { } }; // { dg-error "8:previous definition ... |
google | android | offsetof2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/offsetof2.C | 165 | utf_8 | 9a737c5aa8c1d7760aab812e2a279d4e | #include <cstddef>
struct choke_me
{
int size;
char storage[1];
};
struct offset_is_broken
{
static const int offset = offsetof(choke_me, storage);
};
|
google | android | qualified3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/qualified3.C | 157 | utf_8 | 322abe6d2d840b6218ecf16b70637d21 | // PR c++/18466
int ::i; // { dg-error "" }
void ::f(); // { dg-error "" }
namespace N {
int N::j; // { dg-error "" }
void N::g(); // { dg-error "" }
}
|
google | android | namespace4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/namespace4.C | 208 | utf_8 | 32f8176826963ad9bc2120219dafdf95 | /* PR c++/4652 */
/* { dg-do compile } */
/* Another conflict between namespace IDs and other things. */
namespace A { }
class B {
struct {
int x;
} A;
};
int main() {
B b;
return 0;
}
|
google | android | no-type-defn1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/no-type-defn1.C | 133 | utf_8 | 78d7447f71116b0a069353da50724636 | // PR c++/47144
template<typename> struct A { };
A< struct B { }* >::SomeNonSense // { dg-error "types may not be defined" }
int y;
|
google | android | error50 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error50.C | 265 | utf_8 | 3b28a1724212a02e8ab3970a39206b0c | // PR c++/18747
template<> int i; // { dg-error "template" }
struct A
{
static int i;
};
template<> int A::i; // { dg-error "template" }
template <class T>
struct B
{
static T i;
};
template<> template <> int B<int>::i; // { dg-error "should be 1" }
|
google | android | template19 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template19.C | 197 | utf_8 | ee0c3e9e026c58152af8cead89a077fa | // PR c++/26558
// { dg-do compile }
template<int> struct A
{
template<int> void foo()
{
foo<0>::; // { dg-error "before" }
}
}; |
google | android | ambig4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/ambig4.C | 229 | utf_8 | fae81ce0afd197e10c8c2306551490cd | // PR c++/20293
namespace hide { // { dg-message "hide" }
int k;
}
namespace {
int i;
namespace hide { // { dg-message "hide" }
int j;
}
}
void F(int) {}
int main() {
F(hide::j); // { dg-error "ambiguous" }
}
|
google | android | crash16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash16.C | 198 | utf_8 | 886f2139bd5d589dfe753d49868c3d6d | // PR c++/16971
namespace N {
int i; // { dg-error "" }
// By checking for an explicit keyword on the next line we avoid
// matching an ICE message.
int i; // { dg-error "redefinition" }
}
|
google | android | non-dependent3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/non-dependent3.C | 272 | utf_8 | 4c962ba814ec62b887039d1d3eb9e82b | // PR c++/14586
enum E { e };
E & operator |= (E &f1, const E &f2);
E operator | (const E &f1, const E &f2) {
E result = f1;
result |= f2;
return result;
}
template <typename> void foo () {
const E flags = e | e;
}
template void foo<double> ();
|
google | android | typename2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/typename2.C | 262 | utf_8 | cbccebd52f80be1acc21283b8d2ec373 | template<class T, class U>
struct UnaryReturn {
typedef T Type_t;
};
struct foo
{
template <class T>
typename UnaryReturn<T, int>::Type_t
bar();
};
template<class T>
struct UnaryReturn<T, int> {
typedef bool Type_t;
};
|
google | android | namespace5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/namespace5.C | 132 | utf_8 | 057a40a6b9a4d34bfccc2e241350e8c1 | // PR c++/7229
// { dg-do compile }
namespace A { namespace B { typedef int type; } }
typename A::B<0>::type x; // { dg-error "" }
|
google | android | template3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template3.C | 557 | utf_8 | 302fb93dc0d4883765e18c33d562ade7 | // { dg-do compile }
// PR 9403. We failed to parse template keyword, and we accepted code
// which required one.
template<bool> struct Outer;
template <bool b, typename T>
struct X : Outer<b>::template Inner<T>
{};
template <bool b, typename T>
struct Y : Outer<b>::Inner<T> {}; // { dg-error "used as template" "temp" ... |
google | android | crash21 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash21.C | 135 | utf_8 | 8444b86ea68112c837b56c5795ffea98 | namespace N
{
struct A; // { dg-error "previous declaration" "" }
}
template<int I>
struct N::A {}; // { dg-error "redeclared" "" }
|
google | android | template24 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template24.C | 246 | utf_8 | ad10de81d76fff3ac6f0d42c5b013580 | /* PR c++/29731. This used to ICE in uses_template_parms. */
template<int> struct A {};
void foo()
{
A<({})> a; /* { dg-error "forbids braced-groups within expressions|statement-expressions|template argument 1 is invalid|invalid type" } */
}
|
google | android | error11 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error11.C | 3,384 | utf_8 | f5041366c2776618118a2d579c732b3c | // { dg-do compile }
// { dg-options "-fshow-column" }"
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// Try to find out when the digraph '<:' is used as a mistake, and parse it
// correctly to avoid cascaded errors.
struct B;
template <class A>
struct Foo
{
template <class T>
struct Nested
{... |
google | android | defarg12 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/defarg12.C | 229 | utf_8 | cfc29819542e714a8f85b3361d0dfddd | /* PR28266 This used to ICE in gimple_add_tmp_var */
/* { dg-do compile } */
struct A
{
int i;
A(int = X); /* { dg-error "was not declared in this scope" }*/
};
void foo()
{
A().i; /* { dg-error "default argument" } */
}
|
google | android | crash3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash3.C | 107 | utf_8 | 1893d49612e9a07e189ba50eff994ac3 | template <class T> struct L { struct I {}; };
template <class T> void L<T>::I::foo() {} // { dg-error "" }
|
google | android | template16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template16.C | 327 | utf_8 | ccda843a2ca5dc21854ae45c663fcbad | // PR 21681. ICE with inappropriate access check.
template<int X> struct A;
struct B
{
template<int N> void foo()
{
A<N>::X::Y;
}
}; |
google | android | tmpl-outside2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/tmpl-outside2.C | 280 | utf_8 | 1607193dc384baac839f7e12e19aff0c | // PR c++/50080
template <typename T>
struct A
{
template <typename U>
struct B {};
};
template <typename T>
void test()
{
typename A<T>::template B<int> b;
}
int main()
{
typename A<double>::template B<int> b; // { dg-error "template|expected" "" { target c++98 } }
}
|
google | android | enum4 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/enum4.C | 217 | utf_8 | 37fc43724f8801d8874bb3001647ef4f | // PR c++/37389
// { dg-do compile }
// { dg-options "-std=gnu++98" }
enum
{
A = 9223372036854775807ULL * 2 + 1,
B = B0, // { dg-error "was not declared|overflow" }
C = C0 // { dg-error "was not declared" }
};
|
google | android | crash13 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash13.C | 375 | utf_8 | 3b73d2a22d7abe1b3454cf524a31bd3c | // { dg-do compile }
// PR c++/10583: ICE using template function with invalid signature.
template <typename>
struct A
{
struct B
{};
};
template <typename T>
void func(A<T>::B* ) // { dg-error "variable|template|expression" }
{
}
int main()
{
func<void>(0); // { dg-error "not declared|expression|;" }
} |
google | android | enum9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/enum9.C | 175 | utf_8 | fc78fe78fba2427e541a1c8d2cb5fa07 | // PR c++/53995
enum E1 { e };
void f(E1);
struct A {
int i1,i2,i3,i4,i5,i6,i7,i8,i9,i10;
void g();
void h();
};
void A::g() { enum E2 { e }; }
void A::h() { f(e); }
|
google | android | invalid-op1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/invalid-op1.C | 336 | utf_8 | 094471dbb5519a8fc0004177b10912fa | // PR c++/10150
// { dg-do compile }
template <int I> struct A
{
template <int> struct B
{
enum { e = I * A<I-1>::B }; // { dg-error "dependent-name" "depname" }
// { dg-message "note" "note" { target *-*-* } 9 }
};
};
A<0>::B<0> a; // { dg-message "required" } |
google | android | pr56239 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/pr56239.C | 124 | utf_8 | 574617390f082262f81245e0bfb9c224 | // PR c++/56239
// { dg-do compile }
struct S
{
int operator () () { return 0; }
};
int
main ()
{
return (S ()) ();
}
|
google | android | qualified2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/qualified2.C | 125 | utf_8 | 824f236b15bcc9ff8b13f7275ea14210 | namespace Glib {
template <typename> class Value {};
template <> class Glib::Value<int> {}; // { dg-error "" }
}
|
google | android | error45 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error45.C | 160 | utf_8 | 8fb255415b7882b936372523f4ddf18b | // PR c++/51429
// { dg-do compile }
struct A
{
void foo (double);
void foo (int);
A () { foo = 0; } // { dg-error "invalid use of member function" }
};
|
google | android | linkage2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/linkage2.C | 61 | utf_8 | 259a8909e0634541b2c5e19b89d8cfc7 | // PR c++/27884
extern "C" void foo(register int *my_perl);
|
google | android | try-catch-1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/try-catch-1.C | 313 | utf_8 | fe312b5e22af7a61d39446fc1257d020 | // The problem was that g++ was ICE because
// it was deferring an NULL pointer because
// it should have been taking the operand 1
// instead of the chain in finish_fname_decls.
void fun()
try
{
__FUNCTION__;
}
catch (...) {} |
google | android | error42 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error42.C | 140 | utf_8 | 39e6dd88ac530577aaf1363d98ffd541 | // PR c++/13657
class C { public: int (*f())(); int bar(); };
int (*C::f())() { return C::bar; } // { dg-error "cannot convert 'C::bar'" }
|
google | android | offsetof3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/offsetof3.C | 124 | utf_8 | 7a3600595bbd22af3465f7180daf87b1 | // PR c++/13529
#include <cstddef>
struct A { int i; };
struct B { A a; };
int main()
{
return offsetof(B,a.i) != 0;
}
|
google | android | named_ops | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/named_ops.C | 264 | utf_8 | fe86870b21fda02350088a1a430beacb | /* { dg-do compile } */
/* { dg-options -fpreprocessed } */
/* Tests that C++ named ops are still there with -fpreprocessed. */
/* Source: Neil Booth, 23 May 2002. */
int main ()
{
return 2 xor 2;
} |
google | android | error24 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error24.C | 193 | utf_8 | d1117b500d18941d79a25fa0b2689a43 | // { dg-options "-fshow-column -ansi -pedantic-errors -Wno-long-long" }
// PR c++/19395
struct A {
typedef int ::X; // { dg-error "17:typedef name may not be a nested-name-specifier" }
};
|
google | android | crash6 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash6.C | 136 | utf_8 | 3cae354cb01ecb5097fe78c4d17c8ccd | struct P {};
template <typename >
struct O
{
struct I;
};
template <typename T>
struct O<T>::I::S : P {}; // { dg-error "" }
|
google | android | error16 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error16.C | 205 | utf_8 | b0df2e50d84adadaf774130208c19537 | // { dg-options "-fshow-column" }
// PR c++/16964
struct A
{
struct B {}; // { dg-error "10:previous definition of 'struct A::B'" }
};
struct A::B{}; // { dg-error "11:redefinition of 'struct A::B'" }
|
google | android | template14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template14.C | 116 | utf_8 | 52473f07f21ed228ce211fd495befdbe | // PR c++/14550
struct A {
A();
};
template <int> void foo()
{
A *p = new A;
}
void bar()
{
foo<0>();
}
|
google | android | octal1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/octal1.C | 31 | utf_8 | 619df7743f49825b46dea1243056ee99 | int i = 08; // { dg-error "" }
|
google | android | error26 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error26.C | 367 | utf_8 | 49ccbae96f3a3396f11079096c284f67 | // PR c++/20148
// { dg-options "-fshow-column -ansi -pedantic-errors -Wno-long-long" }
void foo()
{
if (({int c[2];})) ; // { dg-error "7:ISO C.. forbids" "7" }
// { dg-error "17:could not convert" "17" { target *-*-* } 6 }
}
void bar()
{
if (({})); // { dg-error "7:ISO C.. forbids" "7" }
// { dg-error "11:c... |
google | android | attr-externally-visible-2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/attr-externally-visible-2.C | 1,106 | utf_8 | fc7bb3a300dd247cd39bd47963487340 | // { dg-do compile }
// { dg-options "-O -fwhole-program" }
static void foo1 (void) { } // { dg-warning "have effect only on public" }
extern void foo1 (void) __attribute__((externally_visible));
struct C
{
__attribute__((externally_visible)) void foo3 (void) { }
};
__attribute__((externally_visible)) static v... |
google | android | namespace9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/namespace9.C | 70 | utf_8 | 1f98eb04bd0299c0d86df723002f2f85 | namespace A {
void f();
}
int g()
{
struct f { };
using A::f;
}
|
google | android | access9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/access9.C | 185 | utf_8 | c63564a10a99acc084dd7ef3ab31e068 | // PR c++/24782
class Foo { public: typedef int type1; };
class Bar { private: typedef Foo type2; }; // { dg-error "private" }
void g(Bar::type2::type1) {} // { dg-error "context" }
|
google | android | new5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/new5.C | 102 | utf_8 | eb7d271a7110d4e8fc3f749e65b2288f | // PR c++/47450
struct A { };
A* ap = new(struct: A { }); // { dg-error "types may not be defined" }
|
google | android | colon-autocorrect-2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/colon-autocorrect-2.C | 224 | utf_8 | 8e7b288b4c83f50703e3121d871e7ca1 | // PR c++/44523
// { dg-do compile }
namespace x {
struct a { };
}
template <typename t>
class foo {
};
foo<x::a> a1;
foo<x:a> a2; // { dg-error "nested-name-specifier" }
x::a a3 = a2; // { dg-error "conversion" }
|
google | android | template25 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template25.C | 396 | utf_8 | 234b9ea611a84bfc1707e9a1c2741c83 | // PR c++/22318. Improve diagnostic for local template declaration.
// { dg-do compile }
void f(void)
{
template<typename T> class A /* { dg-error "a template declaration cannot appear at block scope" } */
{
};
}
void g(void)
{
template f<int>(); /* { dg-error "expected primary-expression" "primary-expression"... |
google | android | crash26 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash26.C | 336 | utf_8 | 49ff4a07e8b55a4e75a25add1656211b | // Bug 21929: ICE on invalid
template<int> struct A
{
struct B;
};
template<> struct A<void>::B {}; // { dg-error "mismatch|expected|name a type|extra" } |
google | android | typedef5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/typedef5.C | 140 | utf_8 | f60ae2ded91ec2dc8a237b91d1282751 | namespace A
{
typedef int T; // { dg-message "previous declaration" }
}
class A::T x; // { dg-error "using typedef-name|invalid type" }
|
google | android | undefined1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/undefined1.C | 192 | utf_8 | ad9b24c5c7ea39c6bc5b3c4d8a5e8dee | // PR c++/8143
// { dg-do compile }
struct foo
{
X x; // { dg-error "" }
foo(X) {} // { dg-error "" }
foo(X y, int) : x() {} // { dg-error "" }
};
|
google | android | parameter-declaration-2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/parameter-declaration-2.C | 124 | utf_8 | a9d272474ec6fb5e3e50f2e57a2843b8 | void f (int i, int p[i]); // { dg-error "use of parameter .i. outside function body" }
// { dg-prune-output "array bound" }
|
google | android | error21 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/error21.C | 329 | utf_8 | 846c6f61dbc6e84dc0fd697533b320e3 | // PR c++/17393
// { dg-options "-Wall -fshow-column" }
struct A { };
void foo()
{
// Check that we do not complain about an unused
// compiler-generated variable.
A& = a; // { dg-error "6:expected unqualified-id before '=' token" "6" }
// { dg-error "8:'a' was not declared in this scope" "8" { target *-*-* }... |
google | android | new3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/new3.C | 101 | utf_8 | 7f45e0629e3e57a0e0d163a6606b42a5 | // PR c++/28593
// { dg-do compile }
void *p = new (::X; // { dg-error "declared|type-specifier" }
|
google | android | offsetof8 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/offsetof8.C | 205 | utf_8 | b1ce3fdd391495324e49b500d3fb1834 | // PR c++/35321
struct A
{
A operator[] (int);
};
struct B
{
A a;
};
void foo()
{
__builtin_offsetof(B, a[0]); /* { dg-error "cannot apply 'offsetof' when 'operator\\\[\\\]' is overloaded" } */
}
|
google | android | enum5 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/enum5.C | 419 | utf_8 | 52d8bf09effe5fa7a9c7ed5cba8a73ca | // PR c++/41127
#define CHAR_BIT 8
enum EE {ee};
typedef unsigned int T;
struct D {
T : sizeof(unsigned int) * CHAR_BIT; // OK
EE : sizeof(EE) * CHAR_BIT; // OK
enum EE : sizeof(EE) * CHAR_BIT; // not OK
enum EE xxxx : sizeof(EE) * CHAR_BIT; // OK
T x : sizeof(unsigned int) * C... |
google | android | namespace-definition | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/namespace-definition.C | 173 | utf_8 | 8f491718233bf66bea91944d8a3fa4c1 | // PR 30891
// { dg-do compile }
int main() {
int i = 0;
namespace foo { // { dg-error "'namespace' definition is not allowed here" }
int j = 0;
}
return 0;
}
|
google | android | dtor3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/dtor3.C | 529 | utf_8 | 910d21c43d1e636c0d63d98205e45a4a | // { dg-do compile }
// Contributed by Wolfgang Bangerth <bangerth at dealii dot org>
// PR c++/12335: Make sure we don't ICE on the qualified-id form of a
// destructor call.
struct Y {
~Y() {} // { dg-bogus "note" "implemented DR272" { xfail *-*-* } }
};
struct X : Y {
~X() {} // { dg-bogus "not... |
google | android | fn-typedef2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/fn-typedef2.C | 150 | utf_8 | f6754761e7f98517166a9488ce259302 | // Test that merge_types preserves fn cv-quals.
typedef void ft() const;
typedef void V;
typedef V ft() const;
ft f; // { dg-error "qualified" }
|
google | android | non-templ1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/non-templ1.C | 214 | utf_8 | 301b99fe0e3e5ec394c359f6ae5c6580 | // PR c++/9228
// { dg-do compile }
struct A
{
struct B { B(int); };
};
template <typename T> typename A<T>::B foo() { return 1; } // { dg-error "" } |
google | android | ctor9 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/ctor9.C | 165 | utf_8 | 6a2dccebcb4556545a78e5446705ee81 | /* PR c++/37647 */
/* { dg-do compile } */
struct A
{
A() { void A(); } /* { dg-error "return type specification for constructor invalid|non-class scope" } */
};
|
google | android | template27 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/template27.C | 145 | utf_8 | ba5fea52e589d10cf797adaaeee748ac | // PR c++/53563
template<class T>
struct s
{
template<class U>
s(){}
};
int main() {
struct s<void>::s<int> a; // { dg-error "no match" }
}
|
google | android | new1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/new1.C | 183 | utf_8 | 05015bddf7eae5dba9ca2b6c63160450 | struct T; // { dg-error "forward" }
T* manage(T* t);
template <class Obj> struct ObjectSlot0_ {
void create() {
void* tmp = manage(new T()); // { dg-error "incomplete" }
}
};
|
google | android | pragma3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/pragma3.C | 419 | utf_8 | d516a5d017b9be02cd665abb61b0fbaf | // PR c++/25294
// Epiphany makes struct S 8-byte aligned.
// { dg-do run { target { ! epiphany-*-* } } }
extern "C" void abort (void);
struct S
{
char a[3];
#pragma pack(1) /* A block comment
that ends on the next line. */
struct T
{
char b;
int c;
} d;
#pragma pack /*/ */ () // C++ comment
i... |
google | android | dtor14 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/dtor14.C | 109 | utf_8 | ced832c704713d5dd4581483a10c8a33 | // PR c++/39054
struct A {};
template<typename> void foo()
{
A().~int(); // { dg-error "expected" }
}
|
google | android | crash59 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/crash59.C | 93 | utf_8 | 01be7ea2b97a83045196ea78cd77b795 | // PR c++/53003
struct A{ void a{} return b // { dg-error "function definition|expected" }
|
google | android | parse7 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/parse7.C | 424 | utf_8 | c203de39cbb4bd246d0e315aa6662a15 | /* PR c++/3650 */
/* { dg-do compile } */
class class1 {
public:
explicit class1(double a) { data = a; }
double data;
};
class class2 {
public:
class2(class1 a, float t) { }
class2(float t, class1 a) { }
};
int main() {
float t2 = 1.5;
double pir = 3.14159;
// Used to get: error: type specifier omit... |
google | android | parser-pr14875 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/parser-pr14875.C | 351 | utf_8 | ce5771924fa5fd60b270c30c11bee489 | // PR 14875: When using 'or' keyword, the error message speaks of a '||' token
// { dg-do compile }
// { dg-options "" }
using namespace std;
class Sample
{
public:
Sample();
void or(long Digital); // { dg-error "before .or. token" }
};
Sample::Sample()
{
}
void Sample::or(long Digital) // { dg-er... |
google | android | bitfield3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/bitfield3.C | 157 | utf_8 | ca4235a8b75acbf100fc21c249073ba8 | /* PR c++/35320 */
/* { dg-do compile } */
typedef void (func_type)();
struct A
{
friend func_type f : 2; /* { dg-error "with non-integral type" } */
};
|
google | android | ambig3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/ambig3.C | 344 | utf_8 | dccd55557e6e7045693056e69f389dc4 | // PR c++/9452
// { dg-do compile }
template <int> struct A { static const int i = 1; };
template <int> struct B {};
template <typename> int foo(B<0>)
{
return 0;
}
template <typename, int j> B<A<j>::i-1> foo(B<j>)
{
return B<0>();
}
int main()
{
return foo<int>(B<0>());
} |
google | android | ctor2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/ctor2.C | 65 | utf_8 | 31da095055ef151d5be0868d53a4bdcb | // PR c++/19244
typedef struct { void f(); } f;
void f::f() { }
|
google | android | parse2 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/parse2.C | 205 | utf_8 | 0b60dfafca867d56068025a0cd9cee2d | /* PR c++/67 */
/* { dg-do compile } */
template <class T> struct foo {
static const int bar [3];
};
// Used to fail if 2+1 rather than 3.
template <class T> const int foo<T>::bar [2+1] = { 0, 0, 0 };
|
google | android | pr34758 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/pr34758.C | 629 | utf_8 | b195499fe12f3f3c5a8b1fb7605ee881 | // PR 34758 Bad diagnostic for circular dependency in constructor default argument
// { dg-do compile }
// { dg-options "" }
struct A
{
A (const A& = A()); // { dg-error "recursive evaluation of default argument" }
};
struct S {
S(const S& = f()); // { dg-error "default argument\[^\n\]*which is not yet defined" }... |
google | android | parameter-declaration-1 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C | 201 | utf_8 | 19f6aca27efa700bef4477a26d564761 | // Origin: Robert Schiele; PR C++/8799
// { dg-do compile }
struct {
a(void = 0; a(0), a(0) // { dg-error "" "" { target *-*-* } } |
google | android | attr3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/attr3.C | 286 | utf_8 | 84930854b0b0c72879816ff973b235bc | // PR c++/39219
enum __attribute__ ((deprecated)) E { e };
struct S { enum __attribute__ ((deprecated)) F { f = e }; };
int main () {
E x; // { dg-warning "'E' is deprecated" "" }
x = e;
S::F y; // { dg-warning "'F' is deprecated" "" }
y = S::f;
return x + y;
}
|
google | android | expr3 | .C | toolchain/gcc/gcc-4.8.3/gcc/testsuite/g++.dg/parse/expr3.C | 1,007 | utf_8 | 6d7be91bc2c8c6e24eeb0e2834b30879 | /* { dg-do compile } */
#define test(lower, higher, a, b, c, d) \
test_(lower, higher, a, b, c, d, __LINE__)
#define test_(lower, higher, a, b, c, d, line)\
test__(lower, higher, a, b, c, d, line)
/* The first declaration tests that the parentheses are added correctly
by the expression parser. The second tests... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.