[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Internal compiler error in `layout_decl'
From: |
Alex Vinokur |
Subject: |
Internal compiler error in `layout_decl' |
Date: |
Mon, 04 Feb 2002 10:08:42 +0200 |
===============================================================
Windows98
gpp : GNU C++ version 2.95.3 20010315/djgpp (release) (djgpp)
compiled by GNU C version 2.95.3 20010315/djgpp (release).
===============================================================
//============= C++ Code : BEGIN =============
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
//---------------------------
class AAA
{
friend ostream& operator<< (ostream& o, const AAA& a);
public :
int i1_;
string s1_;
AAA (int i1_i = 0, const string& s1_i = string ())
: i1_ (i1_i), s1_ (s1_i)
{
}
~AAA () {}
};
//---------------------------
ostream& operator<< (ostream& o, const AAA& a)
{
return o << "Instance-("
<< a.i1_
<< ", "
<< a.s1_
<< ")"
<< endl;
}
//---------------------------
bool cond1 (const AAA& inst_i)
{
bool ret_value = (inst_i.s1_ == "XYZ");
cout << "["
<< __FUNCTION__
<< "] "
<< "; inst_i.s1_ = "
<< inst_i.s1_
<< "; ret_value = "
<< ret_value
<< endl;
return ret_value;
}
//---------------------------
bool cond2 (const AAA& inst_i, const string& s_i)
{
bool ret_value = (inst_i.s1_ < s_i);
cout << "["
<< __FUNCTION__
<< "] "
<< "; inst_i.s1_ = "
<< inst_i.s1_
<< "; ret_value = "
<< ret_value
<< endl;
return ret_value;
}
//---------------------------
//---------------------------
int main()
{
vector<AAA> v;
v.push_back(AAA (111, "ABC"));
v.push_back(AAA (222, "PRT"));
v.push_back(AAA (333, "XYZ"));
v.push_back(AAA (444, "WVT"));
vector<AAA>::iterator iter;
iter = find_if(v.begin(), v.end(), cond1);
if (iter != v.end())
{
cout << "Found element value : " << (*iter) << endl;
}
iter = find_if(v.begin(), v.end(), ptr_fun (cond1));
if (iter != v.end())
{
cout << "Found element value : " << (*iter) << endl;
}
iter = find_if(v.begin(), v.end(), bind2nd (ptr_fun (cond2), "PRT"));
if (iter != v.end())
{
cout << "Found element value : " << (*iter) << endl;
}
return 0;
}
//============= C++ Code : END ===============
//============= Compilation : BEGIN ==========
%gpp -v -save-temps aaa2.c
Reading specs from d:/sys/djgpp/lib/gcc-lib/djgpp/2.953/specs
gcc version 2.95.3 20010315/djgpp (release)
d:/sys/djgpp/lib/gcc-lib/djgpp/2.953/cpp0.exe -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dunix -Di386 -DGO32
-DDJGPP=2 -DMSDOS -D__unix__ -D__i386__ -D__GO32__ -D__DJGPP__=2
-D__MSDOS__ -D__unix -D__i386 -D__GO32 -D__DJGPP=2 -D__MSDOS
-Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)
-D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-D__tune_pentium__ -imacros d:/sys/djgpp/lib/djgpp.ver -remap aaa2.c
aaa2.ii
GNU CPP version 2.95.3 20010315/djgpp (release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
d:/sys/djgpp/lang/cxx
d:/sys/djgpp/lib/gcc-lib/djgpp/2.953/include
d:/sys/djgpp/include
End of search list.
The following default directories have been omitted from the search
path:
$DJDIR/lib/gcc-lib/djgpp/2.953/../../../../djgpp/include
End of omitted list.
d:/sys/djgpp/lib/gcc-lib/djgpp/2.953/cc1plus.exe aaa2.ii -quiet
-dumpbase aaa2.cc -version -o aaa2.s
GNU C++ version 2.95.3 20010315/djgpp (release) (djgpp) compiled by GNU
C version 2.95.3 20010315/djgpp (release).
d:/sys/djgpp/lang/cxx/stl_function.h: In instantiation of
`binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >':
d:/sys/djgpp/lang/cxx/stl_function.h:231: instantiated from
`bind2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool>, char[4]>(const pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> &, const char (&)[4])'
aaa2.c:90: instantiated from here
d:/sys/djgpp/lang/cxx/stl_function.h:221: forming reference to reference
type `const string &const'
d:/sys/djgpp/lang/cxx/stl_function.h:223: forming reference to reference
type `const AAA &const'
d:/sys/djgpp/lang/cxx/stl_function.h:223:
`binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::operator ()(...)' must be a nonstatic member function
d:/sys/djgpp/lang/cxx/stl_function.h: In function `class
binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> > bind2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool>, char[4]>(const pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> &, const char (&)[4])':
aaa2.c:90: instantiated from here
d:/sys/djgpp/lang/cxx/stl_function.h:233: no matching function for call
to `binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::binder2nd (const pointer_to_binary_function<const AAA
&,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> &, const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &)'
d:/sys/djgpp/lang/cxx/stl_function.h:221: candidates are:
binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::binder2nd(...)
d:/sys/djgpp/lang/cxx/stl_function.h:226:
binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::binder2nd(const binder2nd<pointer_to_binary_function<const
AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> > &)
d:/sys/djgpp/lang/cxx/stl_algo.h: In function `class AAA * find_if<AAA
*, binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> > >(AAA *, AAA *, binder2nd<pointer_to_binary_function<const
AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >, random_access_iterator_tag)':
d:/sys/djgpp/lang/cxx/stl_algo.h:199: instantiated from here
d:/sys/djgpp/lang/cxx/stl_algo.h:158: warning: cannot pass objects of
type `AAA' through `...'
d:/sys/djgpp/lang/cxx/stl_function.h: At top level:
d:/sys/djgpp/lang/cxx/stl_function.h: In instantiation of
`binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::operator ()(...)':
d:/sys/djgpp/lang/cxx/stl_algo.h:158: instantiated from `find_if<AAA
*, binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> > >(AAA *, AAA *, binder2nd<pointer_to_binary_function<const
AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >, random_access_iterator_tag)'
d:/sys/djgpp/lang/cxx/stl_algo.h:199: instantiated from here
d:/sys/djgpp/lang/cxx/stl_function.h:223:
`binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::operator ()(...)' must be a nonstatic member function
d:/sys/djgpp/lang/cxx/stl_function.h: In function `{error}
binder2nd<pointer_to_binary_function<const AAA &,const
basic_string<char,string_char_traits<char>,__default_alloc_template<false,0>
> &,bool> >::operator ()(...)':
d:/sys/djgpp/lang/cxx/stl_function.h:223: Internal compiler error in
`layout_decl', at stor-layout.c:247
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
//============= Compilation : END ============
--
===========================
Alex Vinokur
mailto:address@hidden
mailto:address@hidden
http://up.to/alexvn
http://go.to/alexv_math
===========================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Internal compiler error in `layout_decl',
Alex Vinokur <=