From mboxrd@z Thu Jan 1 00:00:00 1970 From: acss@altavista.net To: gcc-gnats@gcc.gnu.org Subject: c++/4662: g++ recognize a c++ header file (.hpp) as c header file Date: Thu, 25 Oct 2001 16:26:00 -0000 Message-id: <20011023190230.5023.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00496.html List-Id: >Number: 4662 >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:07 PDT 2001 >Closed-Date: >Last-Modified: >Originator: acss@altavista.net >Release: gcc 3.0.1 >Organization: >Environment: Sun SPARC Solaris 5.6 >Description: We have the same problem reported on #3866, with the following addition: 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 cat> test.cpp #include int main() { test(0); } ctrl-D g++ -c test.cpp >Fix: >Release-Note: >Audit-Trail: >Unformatted: