nortel regressions since 97r1

From-SVN: r24097
This commit is contained in:
Benjamin Kosnik 1998-12-04 19:12:58 +00:00
parent 8028e52a02
commit 2f38dfa109
17 changed files with 442 additions and 0 deletions

View File

@ -0,0 +1,12 @@
// 981203 bkoz
// g++/13523
// Build don't link:
template<typename T> class latin_america;
class peru
{
friend class latin_america<int>; // Particular template class friend works
template<class T> friend class latin_america; // This does not work.
};

View File

@ -0,0 +1,21 @@
// 981203 bkoz
// g++/13908
// Build don't link:
class chile
{
public:
protected:
private:
};
typedef void (chile::* pmf) ();
void* foo;
void bar (chile* pobj, pmf pmethod)
{
//-edg: expected member name
//-g++: taking address of bound pointer-to-member expression
foo = (void*) &(pobj->*pmethod); // ERROR -
}

View File

@ -0,0 +1,16 @@
// 981203 bkoz
// g++/14664 - test
// Build don't link:
// Special g++ Options: -fconst-strings
char foo[26];
void bar()
{
//-g++: incompatible types in assignment of 'const char[]' to 'char[]'
//-edg: expression must be a modifiable lvalue
foo = "0123456789012345678901234"; // ERROR - // ERROR -
}

View File

@ -0,0 +1,16 @@
// 981203 bkoz
// g++/14664 + test
// Build don't link:
// Special g++ Options: -fno-const-strings
char foo[26];
void bar()
{
// the addition of the flag "-fno-const-string-literal" reverts to pre-ISO.
// -g++: ANSI C++ forbids assignment of arrays
foo = "0123456789012345678901234"; // WARNING -
}

View File

@ -0,0 +1,77 @@
// 981203 bkoz
// g++/14687
#include <assert.h>
unsigned int gtest;
// 7.3.3 the using declaration
// p 3
struct belieze {
void f(char);
void g(char);
enum E { e };
union { int x; };
};
struct dominica: belieze {
using belieze::f;
void f(int i) { f('c'); } // calls belieze::f(char)
void g(int i) { g('c'); } // recursively calls dominca::g(int)
};
// p 6
namespace A {
void f(int i) { gtest = 1; }
}
using A::f; //f is a synonym for A::f, that is for A::f(int)
namespace A {
void f(char c) { gtest = 3; }
}
void foo(void) {
f('a'); //calls f(int), even though A::f(char) exits
assert (gtest = 1);
}
void bar(void) {
using A::f; //f is a synonm for A::f, that is for A::f(int) and A::f(char)
f('a'); //calls f(char)
assert (gtest = 3);
}
int main(void)
{
foo();
bar();
return 0;
}

View File

@ -0,0 +1,11 @@
// 981203 bkoz
// g++/15071
// gcc invocation fails to link in libstdc++
#include <iostream.h>
int main() {
cout<<"hi"<<endl;
return 0;
}

View File

@ -0,0 +1,21 @@
// 981203 bkoz
// g++/15309
// Build don't link:
// Special g++ Options: -Wnon-virtual-dtor -Weffc++
class bahamian {
public:
bahamian ();
~bahamian ();
};
class miami : public bahamian
{
public:
miami ();
~miami ();
}; // WARNING - // WARNING -

View File

@ -0,0 +1,10 @@
// 981203 bkoz
// g++/15309
// Build don't link:
// Special g++ Options: -Wnon-virtual-dtor -Weffc++
class bermuda {
public:
virtual int func1(int);
~bermuda();
}; // WARNING - // WARNING -

View File

@ -0,0 +1,27 @@
// 981203 bkoz
// g++/15351 - test
// Special g++ Options: -fno-const-strings
#include <assert.h>
bool gtest;
struct acapulco {
acapulco(const char *) { gtest = false; }
acapulco(char *) { gtest = true; }
};
void foo(void)
{
acapulco("some such string\n");
}
int main()
{
foo();
if (!gtest)
assert (0);
return !gtest;
}

View File

@ -0,0 +1,27 @@
// 981203 bkoz
// g++/15351 + test
// Special g++ Options: -fconst-strings
#include <assert.h>
bool gtest;
struct acapulco {
acapulco(const char *) { gtest = true; }
acapulco(char *) { gtest = false; }
};
void foo(void)
{
acapulco("some such string\n");
}
int main()
{
foo();
if (!gtest)
assert (0);
return !gtest;
}

View File

@ -0,0 +1,36 @@
// 981203 bkoz
// g++/15756 test1
// Build don't link:
// Special g++ Options: -Wsign-promo
enum e_value { first = 0, next = 30 };
struct sanjuan {
sanjuan(int value);
sanjuan(unsigned value);
friend sanjuan operator&(const sanjuan& x, const sanjuan& y);
friend int operator!=(const sanjuan& x, const sanjuan& y);
};
extern void mod_enum(e_value*);
extern int a;
void foo(void) {
e_value mod = first;
mod_enum(&mod);
if (mod != next)
++a;
}

View File

@ -0,0 +1,44 @@
// 981203 bkoz
// g++/15756 test2
// Build don't link:
// Special g++ Options: -Wsign-promo
// this test may only be valid for 32bit targets at present
enum e_i {
vali
}
enum_int;
enum e_ui {
valui = 0xF2345678
}
enum_uint;
int i;
unsigned int ui;
struct caracas {
caracas(int);
caracas(unsigned int);
void foo();
};
int main ()
{
caracas obj_ei ( enum_int ); // WARNING - // WARNING -
caracas obj_eui ( enum_uint ); // WARNING - // WARNING -
caracas obj_i ( i );
caracas obj_ui ( ui );
obj_ei.foo();
obj_eui.foo();
obj_i.foo();
obj_ui.foo();
}

View File

@ -0,0 +1,29 @@
// 981203 bkoz
// g++/15799 test1
// Build don't link:
/*
15799.cpp: In function `void foo()':
15799.cpp:21: call of overloaded `sanjose({anonymous enum})' is ambiguous
15799.cpp:13: candidates are: sanjose::sanjose(const sanjose &) <near match>
15799.cpp:14: sanjose::sanjose(unsigned int)
*/
typedef char int_8;
typedef unsigned long uint_32;
class sanjose {
public:
sanjose();
sanjose(const sanjose&);
sanjose(int_8 value); // ERROR - // ERROR -
sanjose(uint_32 value); // ERROR - // ERROR -
};
enum { first, last};
void foo(void) {
sanjose obj(first); // ERROR - // ERROR -
};

View File

@ -0,0 +1,18 @@
// 981203 bkoz
// g++/15800 + test
// Build don't link:
struct panama {
panama();
panama(panama &);
panama& operator=(panama&);
panama& getref() { return *this; }
};
extern panama dig();
void foo() {
panama obj;
obj = dig().getref();
}

View File

@ -0,0 +1,27 @@
// 981203 bkoz
// g++/15822
#include <assert.h>
static unsigned int gcount;
struct playahermosa {
playahermosa() { ++gcount; }
playahermosa(const playahermosa &) { ++gcount; }
~playahermosa() { --gcount; }
};
struct playacoco {
playacoco(const playahermosa& = playahermosa()) { } //create a temporary
};
void foo(playacoco *) { }
int main()
{
playacoco bar[2];
foo(bar);
assert (gcount == 0);
return 0;
}

View File

@ -0,0 +1,44 @@
// 981203 bkoz
// g++/16567
// Build don't link:
typedef bool Bool;
typedef unsigned char Uint8;
typedef unsigned short Uint16;
typedef unsigned int Uint32;
enum e_ms { third = 3, fourth = 4 };
struct bitmask {
Uint8* anon1;
Uint32 anon2;
Uint8 anon3;
Uint8 here: 2;
Uint8 anon4: 2;
Uint8 anon5: 4;
};
struct control {
Uint8 foo_1();
};
inline Uint8 foo_2(bitmask* p) {
return p->here;
}
inline Uint8 control::foo_1() {
return foo_2((bitmask*) this);
}
void foo(void) {
control obj;
control *fp = &obj;
e_ms result;
result = (e_ms) fp->foo_1; // ERROR - // ERROR -
}

View File

@ -0,0 +1,6 @@
// 981204 bkoz
// g++/17930
// Build don't link:
char const one[] = "test";
char const two[] = one; // ERROR - // ERROR -