[Bug c++/41073] New: Array of iostreams

2009-08-14 Thread philippe at fornux dot com
Initialization of an array mistakenly calls the copy constructor:

#include 

std::iostream a[] = {std::iostream(0)};

int main()
{
}


Returns:

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ios_base.h:
In copy constructor 'std::basic_ios
>::basic_ios(const std::basic_ios >&)':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/ios_base.h:779:
error: 'std::ios_base::ios_base(const std::ios_base&)' is private
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:55:
error: within this context
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd: In
copy constructor 'std::basic_iostream
>::basic_iostream(const std::basic_iostream >&)':
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:67:
note: synthesized method 'std::basic_ios
>::basic_ios(const std::basic_ios >&)' first
required here 
arrayinit.cpp: At global scope:
arrayinit.cpp:6: note: synthesized method 'std::basic_iostream >::basic_iostream(const std::basic_iostream >&)' first required here


-- 
   Summary: Array of iostreams
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe at fornux dot com
 GCC build triplet: gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)
  GCC host triplet: Linux 2.6.18-128.4.1.el5 #1 SMP


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



[Bug c++/40794] LIBRARY_PATH not processed

2009-07-18 Thread philippe at fornux dot com


--- Comment #2 from philippe at fornux dot com  2009-07-18 22:32 ---
Well if I set 'export GCC_EXEC_PATH=$HOME/lib' it works correctly.  

Nevertheless perhaps LIBRARY_PATH should be passed to the linker if GCC is
responsible for the linkage.  


-- 

philippe at fornux dot com changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |


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



[Bug c++/40794] New: LIBRARY_PATH not processed

2009-07-17 Thread philippe at fornux dot com
Greetings,

I am trying linking a shared library from my $HOME/lib path.  If I compile
using -L $HOME/lib it works properly.  If I set 'export LIBRARY_PATH=$HOME/lib'
before compiling it complains it can't find the library:
/usr/bin/ld: cannot find -lmylib


Thanks.


-- 
   Summary: LIBRARY_PATH not processed
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: philippe at fornux dot com


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



[Bug c++/35778] New: Wishlist: To override all C pointers with C++ wrappers

2008-03-31 Thread philippe at fornux dot com
Greetings:

It should be possible to override all fundamental pointers with a given class. 
This is very important and can save a lot of trouble.  How about:

template 
  struct T *
  {
...
  };


-- 
   Summary: Wishlist: To override all C pointers with C++ wrappers
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe at fornux dot com


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



[Bug c++/35727] Nested class of specialized template class bug

2008-03-27 Thread philippe at fornux dot com


--- Comment #2 from philippe at fornux dot com  2008-03-28 05:20 ---
** Then if I add the following:

template <>
struct A::B
{
B() 
{
cout << __PRETTY_FUNCTION__ << endl;
}
};


** I get:

nesttempspecbug.cpp:35: error: explicit specialization of non-template
`A::B'
nesttempspecbug.cpp:35: error: explicit specialization of non-template
`A::B'


-- 

philippe at fornux dot com changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |


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



[Bug c++/35727] New: Nested class of specialized template class bug

2008-03-27 Thread philippe at fornux dot com
** I am trying to compile a program that looks like the following but the
compiler cannot recognize which class the nested class belongs to:

#include 


using namespace std;


template 
struct A
{
class B;
friend class B;
};


template <>
struct A
{
class B;
friend class B;
};


template 
struct A::B
{
B() 
{
cout << __PRETTY_FUNCTION__ << endl;
}
};


int main()
{
A::B b;
}


** Reports:
nesttempspecbug.cpp: In function `int main()':
nesttempspecbug.cpp:35: error: aggregate `A::B b' has incomplete type and
cannot be defined


-- 
   Summary: Nested class of specialized template class bug
   Product: gcc
   Version: 3.4.5
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: philippe at fornux dot com
 GCC build triplet: gcc version 3.4.5 (mingw special)
  GCC host triplet: Windows XP
GCC target triplet: MinGW


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



[Bug c++/35641] New: ICE on overload of friend function definition inside a class

2008-03-19 Thread philippe at fornux dot com
The following:
**

template 
struct Message
{
friend ostream & operator << (ostream & out, const Message & self)
{
cout << __PRETTY_FUNCTION__ << endl;

return out;
}
};


typedef Message IntMsg;


inline ostream & operator << (ostream & out, const IntMsg & self)
{
cout << __PRETTY_FUNCTION__ << endl;

return out;
}

int main()
{
IntMsg m;

cout << m << endl;
}



Produces:
*

templateoverload.cpp: In function `std::ostream& operator<<(std::ostream&,
const IntMsg&)':
templateoverload.cpp:33:   instantiated from here
templateoverload.cpp:0: internal compiler error: in change_decl_assembler_name,
at cgraph.c:541


Resolved with out-of-class definition:
**

template 
inline ostream & operator << (ostream & out, const Message & self)
{
cout << __PRETTY_FUNCTION__ << endl;

return out;
}


-- 
   Summary: ICE on overload of friend function definition inside a
class
   Product: gcc
   Version: 3.4.5
Status: UNCONFIRMED
  Severity: critical
      Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe at fornux dot com
 GCC build triplet: gcc version 3.4.5 (mingw special)
  GCC host triplet: Windows XP
GCC target triplet: Mingw


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



[Bug c++/34667] New: Ambiguous error message on partial member specialization

2008-01-03 Thread philippe at fornux dot com
The following code will not compile even if the error message doesn't make
sense, because it obviously knows which member to instantiate.

This may be a compiler bug issue, or and ambiguous error message.


#include 


using namespace std;


template 
class vector
{
vector();

public:
template 
vector(T (& array) [S])
{
cout << sizeof(array) / sizeof(T) << endl;
}
};

int main()
{
vector a((int []) {0, 1, 2, 4, 5});
}



$ g++ temp.cpp
temp.cpp: In function `int main()':
temp.cpp:22: error: no matching function for call to
`vector::vector(int[5])'
temp.cpp:9: note: candidates are: vector::vector(const vector&)
temp.cpp:15: note: vector::vector(T (&)[S]) [with unsigned
int S = 5u, T = int]
temp.cpp:10: note: vector::vector() [with T = int]


-- 
   Summary: Ambiguous error message on partial member specialization
   Product: gcc
   Version: 3.4.6
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: philippe at fornux dot com


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



[Bug c++/29279] New: ICE

2006-09-28 Thread philippe at fornux dot com
const char nullstr[1] = (const char [1]) {0};

int main()
{
}


-- 
   Summary: ICE
   Product: gcc
   Version: 3.4.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe at fornux dot com
 GCC build triplet: Mingw32


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



[Bug c++/28015] Nonspecific error messages

2006-06-13 Thread philippe at fornux dot com


--- Comment #2 from philippe at fornux dot com  2006-06-13 20:17 ---
I was compiling a big project and I ended up with this error message.  I just
tried to compile the same file by preprocessing it first (-E) and I don't have
the error anymore.

Actually I think some dependent file got included twice.  That will explain the
error messages refering to the same locations; therefore it not a compiler
problem but some improper "#ifndef" preprocessor handling in the header files
on my Redhat system.

I will investigate and let you know if I come up with something.


Bests,
Phil


-- 


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



[Bug c++/28015] New: Nonspecific error messages

2006-06-13 Thread philippe at fornux dot com
Greetings:

I am trying to compile an application and I am getting error massages like the
following one.  Obviously the "previous definition" doesn't point to the first
definition of "struct timespec" but to the redundant definition.  This is
therefore pretty useless:

/usr/include/time.h:119: error: redefinition of `struct timespec'
/usr/include/time.h:119: error: previous definition of `struct timespec'



Phil


-- 
   Summary: Nonspecific error messages
   Product: gcc
   Version: 3.4.5
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: philippe at fornux dot com


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