[Bug c++/51146] New: The name clog for a global variable triggers a segfault inside std::pow

2011-11-15 Thread alpha_lc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51146

 Bug #: 51146
   Summary: The name clog for a global variable triggers a
segfault inside std::pow
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: alpha...@hotmail.com


Adding a global variable to the code with a name like clog, while using
std::pow on a std::complex triggers a segfault when std::pow is
reached. A simple example ( http://codepad.org/4Ekpgj91 ):

#include 
#include 
#include 

int clog=0;

int main()
{
std::cout<<"test1"< b(1,-1);
std::cout<<"test "<

[Bug libstdc++/51146] The name clog for a global variable triggers a segfault inside std::pow

2011-11-15 Thread alpha_lc at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51146

--- Comment #2 from alpha_lc at hotmail dot com 2011-11-15 19:56:15 UTC ---
(In reply to comment #1)
> Well the issue is clog is a C99 name for complex log.  I don't have my C++
> standard in front of me but I do know some names are reserved even at the top
> level.

In case it helps on that side, I've asked a VC++ user to try this code and it
worked perfectly.