[Bug c++/41028] New: Compilation error when a class specialization use a typedef define in a template class

2009-08-10 Thread maxime dot fiandino at gmail dot com
I do a partial specialisation of a class. I havec a compilation error if I
specialize on a typedef which is defined in a template class


-- 
   Summary: Compilation error when a class specialization use a
typedef define in a template class
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: maxime dot fiandino at gmail dot com
 GCC build triplet: Linux-i686
  GCC host triplet: Linux-i686
GCC target triplet: Linux-i686


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



[Bug c++/41028] Compilation error when a class specialization use a typedef define in a template class

2009-08-10 Thread maxime dot fiandino at gmail dot com


--- Comment #1 from maxime dot fiandino at gmail dot com  2009-08-10 15:20 
---
Created an attachment (id=18336)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18336&action=view)
simple source with the bug

just use:
g++ main.cc

on 3.46/4.1.1 no error
on 4.4.0/4.4.1
main.cc:30: error: template parameters not used in partial specialization:
main.cc:30: error: 'T'
main.cc:30: error: 'U'


-- 


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



[Bug c++/37111] New: Link error with a no effect lefthand operand of comma on a very small code

2008-08-13 Thread maxime dot fiandino at gmail dot com
Issue with a static const int value of a template class instenciated as a
left-hand operand of comma. The error is an "undefined reference to" during
link which seems quite strange.

 I found this issue because I wrote a ',' instead of '|' in my source
code. Without the -Wall warning: "left-hand operand of comma has no effect" I
should not be able to found the problem

It doesn't seem important but perhaps there is other impacts. Note I also try
with 3.4.6 redhat with same result.

Please apologize if it's a feature ;o)

Source (.cpp and .ii are the same):

template
struct value
{
static const int is =X;
};

int main()
{
int i=0;
int j=value<1>::is;
if (i,++i,1,value<1>::is)
   {++i;}

if (i) return 0;
else return 1;
}

Compilation:
g++ -v --save-temps main.cpp
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.3.1/configure --prefix=/sw/gcc/4.3.1/Linux-i686
--with-gnu-as --with-as=/sw/gcc/4.3.1/Linux-i686/bin/as --with-gnu-ld
--with-ld=/sw/gcc/4.3.1/Linux-i686/bin/ld --with-gmp-lib=/sw/Linux-i686/lib
--with-gmp-include=/sw/Linux-i686/include --with-mpfr-lib=/sw/Linux-i686/lib
--with-mpfr-include=/sw/Linux-i686/include --disable-nls --enable-shared
--enable-long-long --enable-checking --enable-__cxa_atexit
--enable-languages=c,c++ --enable-threads
Thread model: posix
gcc version 4.3.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /sw/gcc/4.3.1/Linux-i686/libexec/gcc/i686-pc-linux-gnu/4.3.1/cc1plus -E -quiet
-v -D_GNU_SOURCE main.cpp -mtune=generic -fpch-preprocess -o main.ii
ignoring nonexistent directory
"/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../include/c++/4.3.1

/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../include/c++/4.3.1/i686-pc-linux-gnu

/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../include/c++/4.3.1/backward
 /usr/local/include
 /sw/gcc/4.3.1/Linux-i686/include
 /sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/include
 /sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /sw/gcc/4.3.1/Linux-i686/libexec/gcc/i686-pc-linux-gnu/4.3.1/cc1plus
-fpreprocessed main.ii -quiet -dumpbase main.cpp -mtune=generic -auxbase main
-version -o main.s
GNU C++ (GCC) version 4.3.1 (i686-pc-linux-gnu)
compiled by GNU C version 4.3.1, GMP version 4.2.2, MPFR version 2.3.1.
warning: GMP header version 4.2.2 differs from library version 4.1.4.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: e6893af2b111fce95679cea083c2c159
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /sw/gcc/4.3.1/Linux-i686/bin/as -v -V -Qy -o main.o main.s
GNU assembler version 2.18 (i686-pc-linux-gnu) using BFD version (GNU Binutils)
2.18
COMPILER_PATH=/sw/gcc/4.3.1/Linux-i686/libexec/gcc/i686-pc-linux-gnu/4.3.1/:/sw/gcc/4.3.1/Linux-i686/libexec/gcc/i686-pc-linux-gnu/4.3.1/:/sw/gcc/4.3.1/Linux-i686/libexec/gcc/i686-pc-linux-gnu/:/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/:/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/:/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../i686-pc-linux-gnu/bin/
LIBRARY_PATH=/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/:/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../i686-pc-linux-gnu/lib/:/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /sw/gcc/4.3.1/Linux-i686/libexec/gcc/i686-pc-linux-gnu/4.3.1/collect2
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o
/usr/lib/crti.o
/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/crtbegin.o
-L/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1
-L/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../../../i686-pc-linux-gnu/lib
-L/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/../../.. main.o
-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/sw/gcc/4.3.1/Linux-i686/lib/gcc/i686-pc-linux-gnu/4.3.1/crtend.o
/usr/lib/crtn.o
main.o: In function `main':
main.cpp:(.text+0x24): undefined reference to `value<1>::is'
collect2: ld returned 1 exit status


-- 
   Summary: Link error with a no effect lefthand operand of comma on
            a very small code
   Product: gcc
   Version: 4.3.1
Status: UNCONFIRMED
  Severity: minor
  Prio

[Bug c++/37111] Link error with a no effect lefthand operand of comma on a very small code

2008-08-13 Thread maxime dot fiandino at gmail dot com


--- Comment #1 from maxime dot fiandino at gmail dot com  2008-08-13 10:55 
---
Created an attachment (id=16065)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16065&action=view)
source code


-- 


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



[Bug c++/37111] Link error with a no effect lefthand operand of comma on a very small code

2008-08-13 Thread maxime dot fiandino at gmail dot com


--- Comment #3 from maxime dot fiandino at gmail dot com  2008-08-13 11:50 
---
Yes, with the static constant define it solve the link problem.

I still doesn't understand why this issue is for:
if (i,++i,1,value<1>::is)
   {++i;}

but not:
value<1>::is;
alone

But it should not be the right place to ask for explanations.

Thanks for your time and sorry for inconvenience.


-- 

maxime dot fiandino at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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