From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9626 invoked by alias); 3 Feb 2012 14:37:54 -0000 Received: (qmail 9611 invoked by uid 22791); 3 Feb 2012 14:37:54 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Feb 2012 14:37:39 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52108] declval() with incomplete type Date: Fri, 03 Feb 2012 14:37: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-Keywords: rejects-valid 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-Changed-Fields: Keywords Status Last reconfirmed Ever Confirmed Known to fail Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-02/txt/msg00366.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52108 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Status|UNCONFIRMED |NEW Last reconfirmed| |2012-02-03 Ever Confirmed|0 |1 Known to fail| |4.6.2, 4.7.0 --- Comment #1 from Jonathan Wakely 2012-02-03 14:37:35 UTC --- Confirmed, x_pair shouldn't be instantiated to form x_pair* Reduced: struct true_type { static const bool value = true; }; struct false_type { static const bool value = false; }; template T&& declval() noexcept; template struct my_t_alloc_p { typedef T value_type; typedef value_type* pointer; // <--- see Incomplete below }; struct type_selector { #if 1 // T::pointer should be present template static decltype( declval(), declval()) __test_p( int ); #else // If the declaration above re-write as below (worse, IMO), then it pass: template static decltype( T::pointer(), declval() ) __test_p( int ); #endif template static false_type __test_p( ... ); }; template struct x_allocator_traits { typedef decltype(type_selector::__test_p(0)) pointer; }; template struct x_pair { A a; }; struct Incomplete { typedef typename x_allocator_traits > >::pointer pointer6; };