From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7589 invoked by alias); 13 Jun 2013 06:59:49 -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 7541 invoked by uid 48); 13 Jun 2013 06:59:44 -0000 From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57599] result of dynamic_cast is just T Date: Thu, 13 Jun 2013 06:59: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.7.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg00661.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57599 Daniel Kr=C3=BCgler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler@googlemail. | |com --- Comment #4 from Daniel Kr=C3=BCgler --- I created a test case for all type conversion operators: struct A {}; struct B : public A {}; template struct is_same { static constexpr bool value =3D false; }; template struct is_same { static constexpr bool value =3D true; }; template T val(); static_assert(is_same(val())), const A*>::value, "Ouch"); static_assert(is_same(val())), const A&>::value, "Ouch"); static_assert(is_same(val())), const A*>::value, "Ouch"); static_assert(is_same(val())), const A&>::value, "Ouch"); static_assert(is_same(val())), const A*>::value, "Ouch"); static_assert(is_same(val())), const A&>::value, "Ouch"); static_assert(is_same(val())), const A*>::value, "Ouch"); // Error! static_assert(is_same(val())), const A&>::value, "Ouch"); // Error! In agreement with that bug report I see failures for the last two even for = gcc 4.9.0 20130609 (experimental) >>From gcc-bugs-return-424283-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 13 07:00:07 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 9192 invoked by alias); 13 Jun 2013 07:00:06 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 9130 invoked by uid 48); 13 Jun 2013 07:00:03 -0000 From: "valeryweber at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57596] select type bug with optional variables? Date: Thu, 13 Jun 2013 07:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: valeryweber at hotmail dot com X-Bugzilla-Status: RESOLVED 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: 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: 2013-06/txt/msg00662.txt.bz2 Content-length: 1277 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57596 --- Comment #2 from Valery Weber --- But the selector is not optional. The problem even remains if I move the optional variables outside the SELECT TYPE (see bellow). Those 2 codes run just fine with other compilers like ifort or xlf. Thanks Valery MODULE base_types TYPE :: base_integer_type INTEGER :: i END TYPE base_integer_type TYPE :: base_character_type CHARACTER( 10 ) :: c END TYPE base_character_type END MODULE base_types PROGRAM main USE base_types IMPLICIT NONE INTEGER::i_val call get ( i_val=i_val ) write(*,*) 'i_val',i_val contains SUBROUTINE get (i_val, c_val) INTEGER, INTENT( OUT ), OPTIONAL :: i_val CHARACTER( : ), INTENT( OUT ), ALLOCATABLE, OPTIONAL :: c_val CLASS( * ), POINTER :: p TYPE( base_integer_type ),target :: i_base INTEGER :: i_val_tmp CHARACTER( 10 ) :: c_val_tmp i_base%i=-12 p=>i_base SELECT TYPE( p ) TYPE IS( base_integer_type ) i_val_tmp = p%i TYPE IS( base_character_type ) c_val_tmp = p%c CLASS DEFAULT stop END SELECT IF(present(i_val)) i_val = i_val_tmp if(present(c_val)) c_val = c_val_tmp END SUBROUTINE get END PROGRAM main