typeof1.C: New test; typeof based on template-dependent type
authorDariush Eslimi <eslimi@loran.com>
Sat, 10 Oct 1998 08:11:06 +0000 (08:11 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sat, 10 Oct 1998 08:11:06 +0000 (08:11 +0000)
* g++.old-deja/g++.ext/typeof1.C: New test; typeof based on
template-dependent type

From-SVN: r22972

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.ext/typeof1.C [new file with mode: 0644]

index a625a218728342cd3876396b141c182c01130c0e..b6a7f6d9f74cd1dea3666253d6a2f6b0e688a8ad 100644 (file)
@@ -1,3 +1,8 @@
+1998-10-10  Dariush Eslimi  <eslimi@loran.com>
+
+       * g++.old-deja/g++.ext/typeof1.C: New test; typeof based on
+       template-dependent type
+
 1998-10-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * g++.old-deja/g++.brendan/parse3.C: XFAILs, not ERRORs
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/typeof1.C b/gcc/testsuite/g++.old-deja/g++.ext/typeof1.C
new file mode 100644 (file)
index 0000000..a21f3c7
--- /dev/null
@@ -0,0 +1,19 @@
+// Build don't link:
+
+// crash test - XFAIL *-*-*
+
+struct inttest {
+  int elem[1];
+};
+
+template <class T>
+void F(T x)
+{
+  typedef typeof(x.elem[0]) dummy;
+  i = 1;
+}
+
+int main() {
+  inttest x;
+  F(x);
+}