From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.dg/opt/pr48967.C | 98 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 gcc/testsuite/g++.dg/opt/pr48967.C (limited to 'gcc/testsuite/g++.dg/opt/pr48967.C') diff --git a/gcc/testsuite/g++.dg/opt/pr48967.C b/gcc/testsuite/g++.dg/opt/pr48967.C new file mode 100644 index 000000000..db2ea5474 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr48967.C @@ -0,0 +1,98 @@ +// PR debug/48967 +// { dg-do compile } +// { dg-options "-g -O2" } + +template struct A; +template struct A +{ + typedef T ref; +}; +template struct B +{ + typedef A t; + typedef typename t::ref ref; + ref operator * () { return ref (); } +}; +template struct I +{ + typedef T *cp; + template struct J + { + typedef I other; + }; +}; +template struct S : public I +{ +}; +template struct E +{ + typedef typename _A::template J ::other at; +}; +template > struct D +{ + typedef E _Base; + typedef typename _Base::at at; + typedef typename at::cp cp; + typedef B H; +}; +template struct F +{ + T *operator -> () { return __null; } +}; +template long +lfloor (T x) +{ + return static_cast (x) - (x && x != static_cast (x)); +} +template long +lround (T x) +{ + return lfloor (x - 0.5) + 1; +} +class M; +template class P; +typedef P Q; +template struct P +{ + float x (); +}; +struct CV +{ + Q c; +}; +struct C +{ + void foo (const CV &) const; + class O; + typedef D > R; + R n; +}; +struct S3 +{ + S3 (int, int); +}; +struct S2 +{ + S3 sx, sy; + S2 (int x = 0, int y = 0, int s = 0, int t = 0) : sx (x, y), sy (s, t) {} +}; +template struct N +{ + int bar (); +}; +struct C::O +{ + N o; + void foo (CV r, int) + { + Q c = r.c; + float t = 0.5 * (o.bar ()); + S2 (lround (c.x ()), t); + } +}; +void +C::foo (const CV &w) const +{ + R::H m; + (*m)->foo (w, 8); +} -- cgit v1.2.3