mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-20 13:09:59 +08:00
friend34.C: New test...
* g++.old-deja/g++.pt/friend34.C: New test; name injection of friend template declared within template class conflicts with nested class of the same name * g++.old-deja/g++.other/badopt1.C: New test; post-increment is ignored * g++.old-deja/g++.other/decl1.C: New test; incorrect parsing of object with direct initializer as function declaration * g++.old-deja/g++.other/decl2.C: New test; duplicate initializers * g++.old-deja/g++.other/null2.C: New test; conditional operator involving const pointer and NULL produces incorrect result * g++.old-deja/g++.other/typename1.C: New test; template-dependent type name without `typename' should be rejected with -pedantic From-SVN: r22770
This commit is contained in:
parent
c30cc19e56
commit
5e95b7c76d
@ -1,3 +1,23 @@
|
||||
1998-10-03 Alexandre Oliva <oliva@dcc.unicamp.br>
|
||||
|
||||
* g++.old-deja/g++.pt/friend34.C: New test; name injection of
|
||||
friend template declared within template class conflicts with
|
||||
nested class of the same name
|
||||
|
||||
* g++.old-deja/g++.other/badopt1.C: New test; post-increment
|
||||
is ignored
|
||||
|
||||
* g++.old-deja/g++.other/decl1.C: New test; incorrect parsing of
|
||||
object with direct initializer as function declaration
|
||||
|
||||
* g++.old-deja/g++.other/decl2.C: New test; duplicate initializers
|
||||
|
||||
* g++.old-deja/g++.other/null2.C: New test; conditional operator
|
||||
involving const pointer and NULL produces incorrect result
|
||||
|
||||
* g++.old-deja/g++.other/typename1.C: New test; template-dependent
|
||||
type name without `typename' should be rejected with -pedantic
|
||||
|
||||
Fri Oct 2 21:55:58 1998 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* g++.old-deja/g++.other/addrof1.C: New test.
|
||||
|
17
gcc/testsuite/g++.old-deja/g++.other/badopt1.C
Normal file
17
gcc/testsuite/g++.old-deja/g++.other/badopt1.C
Normal file
@ -0,0 +1,17 @@
|
||||
// Based on a testcase by Bryan Weston <bryanw@bluemoon.sps.mot.com>
|
||||
// egcs 1.1 fails to increment count
|
||||
|
||||
// execution test - XFAIL *-*-*
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
struct Base { Base() {} }; // removing the constructor fixes the problem
|
||||
struct Derived : Base {}; // so does removing the base class
|
||||
|
||||
int main() {
|
||||
int count = 0;
|
||||
Derived* array[1]; // making this Base*[1] does not fix the problem
|
||||
array[count++] = new Derived (); // but then new Base() does
|
||||
if (count!=1)
|
||||
std::abort();
|
||||
}
|
10
gcc/testsuite/g++.old-deja/g++.other/decl1.C
Normal file
10
gcc/testsuite/g++.old-deja/g++.other/decl1.C
Normal file
@ -0,0 +1,10 @@
|
||||
// Build don't link:
|
||||
// Based on a test case by Phil Blecker <tmwg@inxservices.com>
|
||||
|
||||
// excess errors test - XFAIL *-*-*
|
||||
|
||||
int foo(int);
|
||||
int bar() {
|
||||
int baz(int(foo(0)));
|
||||
int foo = baz;
|
||||
}
|
7
gcc/testsuite/g++.old-deja/g++.other/decl2.C
Normal file
7
gcc/testsuite/g++.old-deja/g++.other/decl2.C
Normal file
@ -0,0 +1,7 @@
|
||||
// Build don't link:
|
||||
// Based on a test-case by Maciej Radziejewski <maciejr@iws.uni-stuttgart.de>
|
||||
|
||||
int i(0)(1); // ERROR - multiple initialization - XCRASH *-*-*
|
||||
int j(2) = 3; // ERROR - multiple initialization
|
||||
int k(4)(5)(6); // ERROR - multiple initialization
|
||||
int m, n(7)(8); // ERROR - multiple initialization
|
14
gcc/testsuite/g++.old-deja/g++.other/null2.C
Normal file
14
gcc/testsuite/g++.old-deja/g++.other/null2.C
Normal file
@ -0,0 +1,14 @@
|
||||
// Based on a testcase by Eric Dumazet <Eric.Dumazet@COSMOSBAY.COM>
|
||||
|
||||
// execution test - XFAIL *-*-*
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
const char * const foo = ""; // foo is not NULL
|
||||
|
||||
int main() {
|
||||
if ((foo == 0) ? 0 : foo) // so this should evaluate to `foo'
|
||||
return 0;
|
||||
else
|
||||
std::abort();
|
||||
}
|
17
gcc/testsuite/g++.old-deja/g++.other/typename1.C
Normal file
17
gcc/testsuite/g++.old-deja/g++.other/typename1.C
Normal file
@ -0,0 +1,17 @@
|
||||
// This code snippet should be rejected with -pedantic
|
||||
// Based on a test case by Louidor Erez <s3824888@techst02.technion.ac.il>
|
||||
|
||||
// Build don't link:
|
||||
// Special g++ Options: -pedantic
|
||||
|
||||
template<class T>
|
||||
class Vector {
|
||||
public:
|
||||
typedef T* iterator;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
void f()
|
||||
{
|
||||
Vector<T>::iterator i = 0; // ERROR - missing typename - XFAIL *-*-*
|
||||
}
|
15
gcc/testsuite/g++.old-deja/g++.pt/friend34.C
Normal file
15
gcc/testsuite/g++.old-deja/g++.pt/friend34.C
Normal file
@ -0,0 +1,15 @@
|
||||
// Build don't link:
|
||||
// excess errors test - XFAIL *-*-*
|
||||
|
||||
// This testcase won't fail if class ::foo is forward-declared in the
|
||||
// global namespace, nor if class bar is not a template class.
|
||||
|
||||
template <typename T = void>
|
||||
class bar {
|
||||
public:
|
||||
friend class foo; // this is not bar::foo, it forward-declares ::foo
|
||||
class foo {};
|
||||
bar() { foo(); } // but this should refer to bar::foo
|
||||
};
|
||||
|
||||
bar<> baz;
|
Loading…
Reference in New Issue
Block a user