template <char I> struct Int2Type { enum { value = I }; typedef Int2Type<I> type; typedef typename Int2Type<I+1>::type next; }; int main(void) { Int2Type<5> i; } g++ compiler compiles the above program successfully (as it should) but spits out the same warning message 5 times. If you change digit 5 in main to say 7, it spits out 7 identical warnings! Essentially, the warnings are repeated as many number of times as the integer parameter to the Int2Type template. Please try g++ "source-file" -o "output-file" -Wall 2>&1 | grep warning
Works correctly on the trunk, that is it does not warn at all.
(In reply to comment #1) > Works correctly on the trunk, that is it does not warn at all. Well with -pedantic it does warn.
Fixed in 4.6.x.