This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug report
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: Bug report
- From: "Michael Kochetkov" <Michael dot Kochetkov at trustworks dot com>
- Date: Tue, 28 Mar 2000 01:35:48 +0400
Hi all,
here is what gcc have asked me:
Windows NT Workstation 4.0 SP 5
Notes:
X<int> x works.
If X is not parameterized it works with an exception been caught (T t
becomes A t of course). Is it Ok? I mean 15.3/16.
gcc -v --save-temps j47.cpp
Reading specs from
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/
2.95.2/specs
gcc version 2.95.2 19991024 (release)
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95.
2/cpp.exe -la
ng-c++ -v -iprefix
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/
2.95.2/ -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Di386 -
D_WIN32 -DWINN
T -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=
__attribute__(
(__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386__ -D_WIN32 -D__WINN
T__ -D_X86_=1
-D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute_
_((__cdecl__))
-D__declspec(x)=__attribute__((x)) -D__i386 -D__WINNT -Asystem(winnt) -Acpu
(i386) -Amachi
ne(i386) -D__EXCEPTIONS -remap -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -
D__i386__ -Di5
86 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ -D__CYGWIN32__ -D
__CYGWIN__ j47
..cpp j47.ii
GNU CPP version 2.95.2 19991024 (release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95.
2/../../../..
/../include/g++-3
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95.
2/../../../..
/../include
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95.
2/../../../..
/i586-cygwin32/include
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95.
2/include
End of search list.
The following default directories have been omitted from the search path:
/usr/include
End of omitted list.
//E/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95.
2/cc1plus.exe
j47.ii -quiet -dumpbase j47.cc -version -o j47.s
GNU C++ version 2.95.2 19991024 (release) (i586-cygwin32) compiled by GNU C
version 2.95.2
19991024 (release).
j47.cpp: In method `A::A()':
j47.cpp:29: Internal compiler error.
j47.cpp:29: Please submit a full bug report.
j47.cpp:29: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for
instructions.
-------------------------------------------------------------------
I have discussed it in the newsgroup comp.lang.c++. Here is the code from
another my reply. I was able to compile it with KAI C++. Your previous
version core dumped, but new one is "confused by earlier errors, bailing
out" only. Here is the code:
#include <iostream>
class v_pointer
{
public:
// ...other overloaded functions...
template <typename T>
operator T* ()
{
return (T*)m_pointer;
}
template <typename T>
v_pointer& operator = (T* t)
{
m_pointer = t;
return *this;
}
template<typename T>
v_pointer& operator++ (int )
m_pointer = (void*)((unsigned int)m_pointer + sizeof(T));
return *this;
}
template<typename T>
v_pointer& operator++ ()
m_pointer = (void*)((unsigned int)m_pointer + sizeof(T));
return *this;
}
private:
void* m_pointer;
};
int
main()
{
char* s = "Hello there!";
v_pointer p;
p = s;
p.operator++<char>();
std::cout << (char*)p << std::endl;
return 0;
}
Please let me know if this is not the proper place to submit this bug
report, and where I should do so in that event.
With regards,
Michael Kochetkov.
j47.cpp
j47.ii