From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7543 invoked by alias); 2 Sep 2014 15:18:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7496 invoked by uid 48); 2 Sep 2014 15:18:25 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63139] [4.8/4.9/5 Regression] Class-scope typedef overwrites typedef of previously defined class Date: Tue, 02 Sep 2014 15:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cf_known_to_work short_desc everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg00856.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63139 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-09-02 Known to work| |4.7.4 Summary|Class-scope typedef |[4.8/4.9/5 Regression] |overwrites typedef of |Class-scope typedef |previously defined class |overwrites typedef of | |previously defined class Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely --- Weird, somehow make_type_list_t and make_type_list_t end up referring to the same specialization. Reduced to remove the library header: template struct type_list {}; template struct make_type_list { using type = type_list; }; // The bug disappears if you use make_type_list directly. template using make_type_list_t = typename make_type_list::type; struct ContainerEndA {}; template struct ContainerA { using type = make_type_list_t; }; struct ContainerEndB {}; template struct ContainerB { using type = make_type_list_t; }; template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; int main() { static_assert( is_same::type, type_list>::value, "This assert doesn't fail, as expected" ); static_assert( is_same::type, type_list>::value, "This assert doesn't fail but it clearly should!" ); static_assert( is_same::type, ContainerB<>::type>::value, "This assert doesn't fail but it clearly should!" ); }