This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17152] New: Useless error message


The following program compiles without errors using gcc 3.3, but 3.4.1 complains:

Reading specs from /usr/lib64/gcc/x86_64-suse-linux/3.4.1/specs
Configured with: /net/monday_ad2/tools/gcc-3.4.1/configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/
lib64 --enable-languages=c,c++,f77,objc,java,ada --disable-checking --enable-libgcj --with-gxx-
include-dir=/usr/include/g++ --with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-
__cxa_atexit x86_64-suse-linux
Thread model: posix
gcc version 3.4.1
 /usr/libexec/gcc/x86_64-suse-linux/3.4.1/cc1plus -E -quiet -v -D_GNU_SOURCE foo.cpp 
-mtune=k8 -o foo.ii
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++
 /usr/include/g++/x86_64-suse-linux
 /usr/include/g++/backward
 /usr/local/include
 /usr/lib64/gcc/x86_64-suse-linux/3.4.1/include
 /usr/lib64/gcc/x86_64-suse-linux/3.4.1/../../../../x86_64-suse-linux/include
 /usr/include
End of search list.
 /usr/libexec/gcc/x86_64-suse-linux/3.4.1/cc1plus -fpreprocessed foo.ii -quiet -dumpbase foo.cpp 
-mtune=k8 -auxbase foo -version -o foo.s
GNU C++ version 3.4.1 (x86_64-suse-linux)
        compiled by GNU C version 3.3.1 (SuSE Linux).
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63559
foo.cpp:12: error: declaration of `operator==' as non-function
foo.cpp:12: error: expected `;' before '<' token
foo.cpp:13: error: declaration of `operator!=' as non-function
foo.cpp:13: error: expected `;' before '<' token

Removing the <> in the program produces some useful information - adding function prototypes 
makes the error go away. If the function prototypes are truly required, please add some useful text to 
this error to make programs written using directions from various texts easier to debug. For example, 
Stroustrup's "The C++ Programming Language" doesn't provide any indication on how to fix this 
problem.

-- 
           Summary: Useless error message
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paavola at skycomputers dot com
                CC: gcc-bugs at gcc dot gnu dot org,leblanc at skycomputers
                    dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]