c++/4661: g++ recognize a c++ header file (.hpp) as c header file
acss@altavista.net
acss@altavista.net
Thu Oct 25 16:26:00 GMT 2001
>Number: 4661
>Category: c++
>Synopsis: g++ recognize a c++ header file (.hpp) as c header file
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Oct 25 16:26:06 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: acss@altavista.net
>Release: gcc 3.0.1
>Organization:
>Environment:
Sun SPARC
Solaris 5.6
>Description:
C++ included headers, located outside current directory are evaluated as C headers.
If we include a .hpp file in a C++ source file (either with <> or "") and they are outside, we receive the lots of errors like:
In file included from smalldate.cpp:4:
/opt/tuxedo/include/smalldate.hpp:29: declaration of C function `const
middleware::smalldate middleware::operator-(const middleware::smalldate&,
int)' conflicts with
/opt/tuxedo/include/smalldate.hpp:27: previous declaration `const int
middleware::operator-(const middleware::smalldate&, const
middleware::smalldate&)' here
Actually, these are overloaded C++ functions ...
>How-To-Repeat:
cat> test.hpp
int test(int i);
int test(float f);
ctrl-D
mv test.hpp <somewhere on the C++ include path>
cat> test.cpp
#include <test.hpp>
int main() {
test(0);
}
ctrl-D
g++ -c test.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list