mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-09 12:57:19 +08:00
new
From-SVN: r17654
This commit is contained in:
parent
9c0d03672f
commit
82bf778342
7
gcc/testsuite/g++.old-deja/g++.other/field1.C
Normal file
7
gcc/testsuite/g++.old-deja/g++.other/field1.C
Normal file
@ -0,0 +1,7 @@
|
||||
// Build don't link:
|
||||
|
||||
struct X
|
||||
{
|
||||
static const bool b = true;
|
||||
static const int i = b ? 1 : 2;
|
||||
};
|
10
gcc/testsuite/g++.old-deja/g++.other/init1.C
Normal file
10
gcc/testsuite/g++.old-deja/g++.other/init1.C
Normal file
@ -0,0 +1,10 @@
|
||||
extern "C" void abort();
|
||||
|
||||
int i;
|
||||
int j = i++;
|
||||
|
||||
int main()
|
||||
{
|
||||
if (i != 1)
|
||||
abort();
|
||||
}
|
20
gcc/testsuite/g++.old-deja/g++.other/init2.C
Normal file
20
gcc/testsuite/g++.old-deja/g++.other/init2.C
Normal file
@ -0,0 +1,20 @@
|
||||
// Special g++ Options: -O3
|
||||
|
||||
typedef int (*fp)();
|
||||
|
||||
struct S
|
||||
{
|
||||
fp f;
|
||||
};
|
||||
|
||||
static int f()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const S s = { &f };
|
||||
|
||||
int main()
|
||||
{
|
||||
return (*s.f)();
|
||||
}
|
14
gcc/testsuite/g++.old-deja/g++.other/realloc.C
Normal file
14
gcc/testsuite/g++.old-deja/g++.other/realloc.C
Normal file
@ -0,0 +1,14 @@
|
||||
// Build don't link:
|
||||
|
||||
extern "C" void realloc();
|
||||
|
||||
class bug {
|
||||
public:
|
||||
void realloc(int foo,int bar);
|
||||
};
|
||||
|
||||
void f() {
|
||||
bug c;
|
||||
c.realloc(50,50);
|
||||
}
|
||||
|
20
gcc/testsuite/g++.old-deja/g++.pt/ttp40.C
Normal file
20
gcc/testsuite/g++.old-deja/g++.pt/ttp40.C
Normal file
@ -0,0 +1,20 @@
|
||||
#include <vector>
|
||||
|
||||
template<class E,template<class> class DD = std::vector> class C
|
||||
{
|
||||
DD<E> d;
|
||||
public:
|
||||
int f();
|
||||
};
|
||||
|
||||
template<class E,template<class> class DD> int C<E,DD>::f()
|
||||
{
|
||||
DD<E> d2;
|
||||
return d2.size();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
C<int> c;
|
||||
c.f();
|
||||
}
|
23
gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
Normal file
23
gcc/testsuite/g++.old-deja/g++.pt/ttp41.C
Normal file
@ -0,0 +1,23 @@
|
||||
template<template<class> class D,class E> class C
|
||||
{
|
||||
public:
|
||||
int g() { return 1; }
|
||||
};
|
||||
|
||||
template<class T> class D
|
||||
{
|
||||
public:
|
||||
int f();
|
||||
};
|
||||
|
||||
template<class T> int D<T>::f()
|
||||
{
|
||||
C<D,D> c;
|
||||
return c.g();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
D<char> d;
|
||||
d.f();
|
||||
}
|
Loading…
Reference in New Issue
Block a user