public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marc.glisse at normalesup dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/49107] [C++0x] incomplete type regression with std::pair
Date: Sun, 22 May 2011 13:29:00 -0000	[thread overview]
Message-ID: <bug-49107-4-Noc43PNS58@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49107-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49107

--- Comment #5 from Marc Glisse <marc.glisse at normalesup dot org> 2011-05-22 13:03:53 UTC ---
(In reply to comment #4)
> Thanks Marc. Well, now I would say it's a C++ front-end issue.

Ok.

> Consider the below: uncomment the seemingly unrelated VectorH3 constructor from
> const Line_3&, and doesn't compile anymore.

Yes, I left it there for a reason ;-)

Stripping <type_traits> to have 0 includes:

namespace std
{
        template<typename _Tp>
                _Tp declval() noexcept;

        template<typename _Tp , typename = decltype(::new
_Tp(declval<_Tp&&>()))>
                struct ploum
                {
                        static const bool value=true;
                };

        template<class _T2>
                struct pair
                {
                        _T2 second;
                        void swap(pair& __p)
                                noexcept(ploum<_T2>::value);
                };
}

template < class R_ >
struct VectorH3
{
        typedef typename R_::RT                   RT;
        typedef typename R_::Ray_3                Ray_3;
        typedef typename R_::Line_3               Line_3;
        VectorH3() {}
        VectorH3(const Ray_3& r) ;
        VectorH3(const Line_3& l) ;
        VectorH3(const RT& x, const RT& y) ;
};

template < class R_ >
class RayH3
{
        typedef typename R_::Vector_3             Vector_3;
        typedef std::pair<Vector_3>             Rep;
        Rep base;
};

template < class R_ >
struct LineC3
{
        typedef typename R_::Vector_3             Vector_3;
        typedef std::pair<Vector_3>             Rep;
        Rep base;
};

struct Kernel
{
        typedef double                                  RT;
        typedef VectorH3<Kernel>                        Vector_3;
        typedef LineC3<Kernel>                          Line_3;
        typedef RayH3<Kernel>                           Ray_3;
        struct Construct_vector_3
        {
                Vector_3 operator()(const RT& x, const RT& y)
                        const
                        { return Vector_3(x, y); }
        };
};


int main()
{
        Kernel::Construct_vector_3()( 8, 2);
}


  parent reply	other threads:[~2011-05-22 13:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 11:18 [Bug libstdc++/49107] New: " marc.glisse at normalesup dot org
2011-05-22 12:15 ` [Bug libstdc++/49107] " paolo.carlini at oracle dot com
2011-05-22 12:23 ` paolo.carlini at oracle dot com
2011-05-22 12:44 ` marc.glisse at normalesup dot org
2011-05-22 13:23 ` [Bug c++/49107] " paolo.carlini at oracle dot com
2011-05-22 13:29 ` marc.glisse at normalesup dot org [this message]
2011-05-25 12:37 ` [Bug c++/49107] [C++0x][4.7 Regression] " paolo.carlini at oracle dot com
2011-05-25 12:38 ` paolo.carlini at oracle dot com
2011-06-04  5:56 ` jason at gcc dot gnu.org
2011-06-04  6:18 ` jason at gcc dot gnu.org
2011-06-04  6:58 ` paolo.carlini at oracle dot com
2011-06-04  7:06 ` paolo.carlini at oracle dot com
2011-06-04  7:34 ` paolo.carlini at oracle dot com
2011-06-04  9:32 ` marc.glisse at normalesup dot org
2011-06-04 12:28 ` redi at gcc dot gnu.org
2011-06-04 23:36 ` jason at gcc dot gnu.org
2011-06-04 23:42 ` jason at gcc dot gnu.org
2011-06-05  7:34 ` paolo.carlini at oracle dot com
2011-06-05  8:49 ` paolo.carlini at oracle dot com
2011-06-08 21:36 ` jason at gcc dot gnu.org
2011-06-10 20:41 ` marc.glisse at normalesup dot org
2011-06-14 19:31 ` jason at gcc dot gnu.org
2011-06-15  3:53 ` jason at gcc dot gnu.org
2011-06-15  3:58 ` jason at gcc dot gnu.org
2011-06-16 16:00 ` marc.glisse at normalesup dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49107-4-Noc43PNS58@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).