diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/opt/pr48967.C | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr48967.C')
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr48967.C | 98 |
1 files changed, 98 insertions, 0 deletions
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 <typename> struct A; +template <typename T> struct A <T *> +{ + typedef T ref; +}; +template <typename T, typename> struct B +{ + typedef A <T> t; + typedef typename t::ref ref; + ref operator * () { return ref (); } +}; +template <typename T> struct I +{ + typedef T *cp; + template <typename T1> struct J + { + typedef I <T1> other; + }; +}; +template <typename T> struct S : public I <T> +{ +}; +template <typename T, typename _A> struct E +{ + typedef typename _A::template J <T>::other at; +}; +template <typename T, typename _A = S <T> > struct D +{ + typedef E <T, _A> _Base; + typedef typename _Base::at at; + typedef typename at::cp cp; + typedef B <cp, D> H; +}; +template <class T> struct F +{ + T *operator -> () { return __null; } +}; +template <typename T> long +lfloor (T x) +{ + return static_cast <long>(x) - (x && x != static_cast <long>(x)); +} +template <typename T> long +lround (T x) +{ + return lfloor (x - 0.5) + 1; +} +class M; +template <typename> class P; +typedef P <M> Q; +template <typename> struct P +{ + float x (); +}; +struct CV +{ + Q c; +}; +struct C +{ + void foo (const CV &) const; + class O; + typedef D <F <O> > 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 <typename> struct N +{ + int bar (); +}; +struct C::O +{ + N <float> 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); +} |