This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: another small thing


-------------------
#include <cmath>
#include <string>

int main()
{
  std::string s("xxx");
  return 0;
}
-------------------
g++ -Wshadow test.cpp
is give the error for me (ok if I miss the -Wshadow...:_)

Benjamin Kosnik wrote:
> 
> can't reproduce this with this simple test case
> 
> #include <cmath>
> #include <string>
> 
> int main()
> {
>   using namespace std;
> 
>   string test("miles, kind of blue");
>   return 0;
> }
> 
> Perhaps you could provide more detail?
> 
> -benjamin
> 
> > `std::basic_string<_CharT, _Traits, _Alloc>::basic_string (const _CharT *, const
> > _Alloc &) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc =
> > std::allocator<char>]'
> > /usr/include/g++-v3/bits/locale_facets.h:1311:   instantiated from here
> > /usr/include/g++-v3/bits/basic_string.h:301: warning: declaration of `__j1'
> > shadows global declaration
> > -------------------------
> > what is the global __j1 anyway ? it's come from math.h with friends:
> > j0 j1 jn y0 y1 yn
> > the soulution would be to not include cmath before string, but:-((

-- 
 -- Levente
 "The only thing worse than not knowing the truth is
  ruining the bliss of ignorance."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]