This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10212: Preprocessor ## problem
- From: rwgk at cci dot lbl dot gov
- To: gcc-gnats at gcc dot gnu dot org
- Date: 25 Mar 2003 18:00:43 -0000
- Subject: c++/10212: Preprocessor ## problem
- Reply-to: rwgk at cci dot lbl dot gov
>Number: 10212
>Category: c++
>Synopsis: Preprocessor ## problem
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Mar 25 18:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Ralf W. Grosse-Kunstleve
>Release: cvs gcc-3_3-branch 2003-03-25 approx. 08:00AM PST
>Organization:
>Environment:
Redhat 7.3 on Pentium
>Description:
The code below fails to compile with current cvs gcc 3.3:
% cat z.cpp
# define BOOST_PYTHON_INPLACE_OPERATOR(op) \
template <class R> \
inline R \
operator##op(R const& a, R const& b ) \
{ \
return a+b; \
}
BOOST_PYTHON_INPLACE_OPERATOR(+)
% gcc --version
gcc (GCC) 3.3 20030325 (prerelease)
% gcc -c z.cpp
z.cpp:9:32: pasting "operator" and "+" does not give a valid preprocessing token
% echo $status
1
The original code compiles with a large number of compilers incl. several EDG-based, Visual C++ and gcc 2.96 - gcc 3.2.2. Older gcc's issue a warning which can be suppressed with -w.
>How-To-Repeat:
See description.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: