[Bug c++/56558] New: Address of operator with template base class member (C++ source compile error)

2013-03-06 Thread thierry.moreau at connotech dot com


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



 Bug #: 56558

   Summary: Address of operator with template base class member

(C++ source compile error)

Classification: Unclassified

   Product: gcc

   Version: 4.6.4

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: c++

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: thierry.mor...@connotech.com





Created attachment 29606

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29606

C++ source code (minimal)



The C++ source file attached is minimal and causes a compiler error with 4.2

and 4.6 (latest snapshot), but neither 4.7 (except a 4.7.0 RC) nor 4.8.



In member function 'void t2::f() [with int SIZE = 1000]':

error: cannot convert 'int t1<1000>::*' to 'int*' in initialization


[Bug c++/56558] Address of operator with template base class member (C++ source compile error)

2013-03-06 Thread thierry.moreau at connotech dot com


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



--- Comment #1 from Thierry Moreau  
2013-03-07 02:02:05 UTC ---

Latest check was made with tools:



GCC_VERS=4.6-20130301

BINUTILS_VERS=2.23

GMP_VERS=5.0.5

MPFR_VERS=3.1.1

MPC_VERS=1.0.1



../gcc-${GCC_VERS}/configure \

-prefix=$HOME/tools_${NEXT_DEVLEVEL} \

-with-gmp=$HOME/tools_${NEXT_DEVLEVEL} \

-with-mpfr=$HOME/tools_${NEXT_DEVLEVEL} \

-with-mpc=$HOME/tools_${NEXT_DEVLEVEL} \

-program-prefix=${NEXT_DEVLEVEL_} \

-with-build-time-tools=$HOME/tools_${NEXT_DEVLEVEL} \

-enable-threads=posix \

-enable-clocale=gnu \

-disable-nls \

-enable-__cxa_atexit \

-enable-languages=c,c++ \

-with-boot-ldflags="-Wl,-rpath-link=$HOME/tools_${NEXT_DEVLEVEL}/lib

-Wl,-rpath=$HOME/tools_${NEXT_DEVLEVEL}/lib -Wl,-gc-sections"


[Bug c++/56558] Address of operator with template base class member (C++ source compile error)

2013-03-06 Thread thierry.moreau at connotech dot com


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



--- Comment #3 from Thierry Moreau  
2013-03-07 02:11:20 UTC ---

pinskia at gcc dot gnu.org wrote:

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

> 

> --- Comment #2 from Andrew Pinski  2013-03-07 
> 02:07:47 UTC ---

>> The C++ source file attached is minimal and causes a compiler error with 4.2

>> and 4.6 (latest snapshot), but neither 4.7 (except a 4.7.0 RC) nor 4.8.

> 

> So it was fixed in 4.7.

> 

Yes.


[Bug c++/56558] Address of operator with template base class member (C++ source compile error)

2013-03-07 Thread thierry.moreau at connotech dot com


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



--- Comment #5 from Thierry Moreau  
2013-03-07 14:45:20 UTC ---

paolo.carlini at oracle dot com wrote:

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

> 

> Paolo Carlini  changed:

> 

>What|Removed |Added

> 

>  Status|UNCONFIRMED |RESOLVED

>  Resolution||DUPLICATE

> 

> --- Comment #4 from Paolo Carlini  
> 2013-03-07 08:47:18 UTC ---

> Indeed.

> 

> *** This bug has been marked as a duplicate of bug 48593 ***

> 

Indeed, and thanks.



I reported this bug (against 4.6 -- still supported by volunteers) 

because it *might* prevent the C++-converted gcc from being build with 

gcc in the range 3.x to 4.6.



Working around bugs 48593 or 56558 is easy: get the pointer value 

through a reference declaration. The workaround may become a recommended 

coding style, with rationale being lost in the meantime.



I don't know the terminology for gcc developers for applying a bug 

correction to an earlier version.



So, I'm leaving it to you to determine if these bugs are relevant to 4.6 

(and prior?) in view of the C++ conversion.



Thanks and best regards,