[Sun C++] fails to #include standard headers more than once
-----------------------------------------------------------
Key: STDCXX-936
URL: https://issues.apache.org/jira/browse/STDCXX-936
Project: C++ Standard Library
Issue Type: Bug
Components: External
Environment: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
Reporter: Martin Sebor
The program below fails to compile with Sun C++. The compiler assumes
{{<limits>}} refers to its own header rather than the one provided by the user
in the same directory as the program source code, t.cpp.
{noformat}
$ cat -n limits && cat -n t.cpp && CC -c -I. -library=%none -V t.cpp
1 // limits
2 static int foo = 0;
1 // t.cpp
2 #include <limits>
3 #define foo bar
4 #include <limits>
5 #undef foo
6
7 int main ()
8 {
9 return foo + bar;
10 }
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
ccfe: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25
"t.cpp", line 9: Error: bar is not defined.
1 Error(s) detected.
{noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.