Linked by Thom Holwerda on Fri 9th Mar 2007 15:36 UTC, submitted by Johan Thelin
General Development "Sometimes GCC emits something that can be described as Haiku poems - and you have no clue as to what it really is complaining about. This page is a collection of such gems, their meaning in English and how to solve the problem."
Thread beginning with comment 220016
To read all comments associated with this story, please click here.
C++ Template Errors
by zlynx on Fri 9th Mar 2007 17:18 UTC
zlynx
Member since:
2005-07-20

The more fun ones are template errors. Two pages of output and you still have no idea what you did wrong.

RE: C++ Template Errors
by stestagg on Fri 9th Mar 2007 20:45 in reply to "C++ Template Errors"
stestagg Member since:
2006-06-03

Yeah. Makes me nervous about the wth is going on with template code that compiles but isn't 100% correct. And how many crashes all that ridiculous complexity has caused.

Reply Parent Bookmark Score: 2

RE: C++ Template Errors
by WorknMan on Fri 9th Mar 2007 21:30 in reply to "C++ Template Errors"
WorknMan Member since:
2005-11-13

The more fun ones are template errors. Two pages of output and you still have no idea what you did wrong.

Well, you're coding in C++, yes? There's where you went wrong ;) lol

Reply Parent Bookmark Score: 4

RE: C++ Template Errors
by rayiner on Fri 9th Mar 2007 21:33 in reply to "C++ Template Errors"
rayiner Member since:
2005-07-06

Write some moderately complex code using Boost.Lambda, then make a typo. Just one, in an innocuous a place as you can find. G++ will just barf all over your shoes, and you won't be able to get the smell out for a week.

The complete illegibility of template expansion errors has killed any enthusiasm I had for Boost, or "modern C++" in general. Its not really the fault of the compilers, C++ templates are just a fundamentally crappy feature from an ease-of-use and ease-of-implementation point of view.

Edited 2007-03-09 21:36

Reply Parent Bookmark Score: 5

RE[2]: C++ Template Errors
by fretinator on Fri 9th Mar 2007 22:58 in reply to "RE: C++ Template Errors"
fretinator Member since:
2005-07-06

I definitely have found Java to give more specific errors when there are compile problems - I think it is due to the degree of reflection in the language itself. I think that makes it an easier job for the compiler to spot errors.

Reply Parent Bookmark Score: 3

RE[2]: C++ Template Errors
by zlynx on Fri 9th Mar 2007 23:22 in reply to "RE: C++ Template Errors"
zlynx Member since:
2005-07-20

I actually like C++ templates and Boost quite a lot. It's just the compiler errors that suck.

It's much easier to find the bug by inspecting the code than reading the error.

Reply Parent Bookmark Score: 2