aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@gcc.gnu.org>1998-02-12 18:20:08 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>1998-02-12 18:20:08 +0000
commitc4e8876e9b153cbf6fd7b50b005b43d435163196 (patch)
treef30c015fb28e4cb68d397e02a8bcdf6e7820b095 /gcc
parent2df0603278c758f16d010cc8c67a633a9ac3d1e4 (diff)
downloadgcc-c4e8876e9b153cbf6fd7b50b005b43d435163196.zip
gcc-c4e8876e9b153cbf6fd7b50b005b43d435163196.tar.gz
gcc-c4e8876e9b153cbf6fd7b50b005b43d435163196.tar.bz2
testcase for g++/14837 From-SVN: r17882
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/typedef01.C51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/typedef01.C b/gcc/testsuite/g++.old-deja/g++.benjamin/typedef01.C
new file mode 100644
index 0000000..179740d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/typedef01.C
@@ -0,0 +1,51 @@
+// Build don't link:
+//980205 bkoz
+
+//7.1.3 the typedef specifier
+
+
+//p1
+typedef int MILES, *KLICKSP;
+MILES distance;
+extern KLICKSP metricp;
+
+//p2--can redefine to same type
+typedef struct s { /* ... */ } s;
+typedef int I;
+typedef int I;
+typedef I I;
+
+//p3--cannot redefine to a different type in a given scope
+class complex2 { /* ... */ };// ERROR - .*
+typedef int complex2;// ERROR - .*
+typedef int complex3;// ERROR - .*
+class complex3 { /* ... */ };// ERROR - .*
+
+
+//p4
+/*
+4 A typedef-name that names a class is a class-name (_class.name_). If
+ a typedef-name is used
+ 1) following the class-key in an elaborated-type-specifier
+ 2) or in the class-head of a class declaration
+ 3) or is used as the identifier in the declarator for a
+ constructor or destructor declaration
+ the program is ill-formed. [Example:
+*/
+struct S {
+ S();
+ ~S();
+};
+
+typedef struct S T;
+
+S a = T(); // OK
+struct T * p; // error
+
+//case01
+typedef bool short;// ERROR - .*
+
+
+
+
+