[Bug c++/43352] keyword 'and' defined when even in the absence of iso646

2010-03-12 Thread mdjones0978-gcc at yahoo dot com


--- Comment #1 from mdjones0978-gcc at yahoo dot com  2010-03-13 03:58 
---
Created an attachment (id=20098)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20098action=view)
Example code

compile with 

g++ test.cpp


-- 


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



[Bug c++/43352] keyword 'and' defined when even in the absence of iso646

2010-03-12 Thread pinskia at gmail dot com


--- Comment #2 from pinskia at gmail dot com  2010-03-13 03:59 ---
Subject: Re:   New: keyword 'and' defined when even in the absence of iso646



Sent from my iPhone

On Mar 12, 2010, at 7:54 PM, mdjones0978-gcc at yahoo dot com
gcc-bugzi...@gcc.gnu.org 
  wrote:

 = test.cpp ==
 #include string

 std::string and( AND );

 #ifdef and
 #undef and
 #endif
 #define and

  error msgs =
 test.cpp:5:8: error: and cannot be used as a macro name as it is  
 an operator
 in C++
 test.cpp:8:9: error: and cannot be used as a macro name as it is  
 an operator
 in C++
 test.cpp:3: error: expected unqualified-id before ââ token


 Several comments along this theme.
 http://stackoverflow.com/questions/2419805/when-did-and-become-an-operator-in-c
 http://en.wikipedia.org/wiki/Iso646.h


C++ is not C. The C++ standard says these are keywords and not defines  
which is unlike the C standard.





 -- 
   Summary: keyword 'and' defined when even in the absence of  
 iso646
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mdjones0978-gcc at yahoo dot com


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



-- 


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



[Bug c++/43352] keyword 'and' defined when even in the absence of iso646

2010-03-12 Thread mdjones0978-gcc at yahoo dot com


--- Comment #3 from mdjones0978-gcc at yahoo dot com  2010-03-13 03:59 
---
g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1
Linux 2.6.31-20-generic #57-Ubuntu SMP Mon Feb 8 09:05:19 UTC 2010 i686
GNU/Linux


-- 


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



[Bug c++/43352] keyword 'and' defined when even in the absence of iso646

2010-03-12 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2010-03-13 04:37 ---
Use -fno-operator-names if you want these keywords not to be keywords in C++. 
Closing as invalid because these are keywords in C++.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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