0

While compiling some code, I received the following strange message from g++ 4.3.4:

...include/boost/property_tree/stream_translator.hpp: In member function 'typename
boost::enable_if<boost::property_tree::detail::is_translator<Translator>, Type>::type
boost::property_tree::basic_ptree<Key, Data, KeyCompare>::get_value(Translator) const
[with Type = ObjectType, Translator = boost::property_tree::stream_translator<char,
std::char_traits<char>, std::allocator<char>, ObjectType>, Key = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, Data = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, KeyCompare =
std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]':
...include/boost/property_tree/stream_translator.hpp:189: note: 'e' was declared here

There's no warning or error near by, and I've never seen such a thing from g++ before. Does anyone have any idea what's going on?

corning
  • 361
  • 5
  • 20
Trebor Rude
  • 1,904
  • 1
  • 21
  • 31
  • 3
    There should be something before all of this that it's attached to, such as `In member function multiple definitions of 'e'` or something. – chris Apr 06 '13 at 00:21
  • So I would have thought, @chris, but there's nothing preceding it. Unfortunately, this is work code, so I don't have much time to spend trying to isolate it, and I have to be very careful about what I post. It doesn't seem to be hurting anything, I'm just curious as to what's causing it. – Trebor Rude Apr 06 '13 at 00:48
  • I'll try this with a newer version of g++ (but probably not until next week) and see what happens. – Trebor Rude Apr 06 '13 at 00:52

2 Answers2

0

GCC, in this case, is attempting to provide context to where a further error occurs. You've only shown a snippet and not the full error, but this is what's happening.

This usually happens during template expansion. GCC is attempting to provide context under which the expansion occurred, so you have more info to fix the issue. These "notes" can be very useful when you've nested and/or complex templates.

The easiest way to fix these errors is to work top-down, correcting the first error you see and move to the next.

Nathan Ernst
  • 4,540
  • 25
  • 38
  • Except it isn't an error. The file that produces this note compiles just fine. It's not a warning, either. That's what's confusing. The lines I've posted are the only output from `g++` for this file. – Trebor Rude Apr 06 '13 at 01:00
  • Can you provide a more complete output, then? If this isn't the case, more context is definitely needed. – Nathan Ernst Apr 06 '13 at 01:02
0

I know this is an old thread, but I am suddenly seeing this same thing after upgrading to a newer version of wxWidgets (from 3.0 to 3.1) and also of g++ (now running g++ 5.3.1).

Preceding the "note" is a warning calling attention to a class created using a constructor marked as deprecated in the new version of wxWidgets. The note simply seems to be showing where the deprecated version of the constructor is declared:

/home/uwake/programs/wx/cuds_db/gp/gpSimple.cpp:157:93: warning:
’wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)’
is deprecated: use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants
[-Wdeprecated-declarations]
     fnt = wxFont ( 12, wxFONTFAMILY_ROMAN, wxNORMAL, wxNORMAL, false, "Times New Roman" );
                                                                                         ^
In file included from /usr/local/include/wx-3.1/wx/font.h:524:0,
             from /usr/local/include/wx-3.1/wx/window.h:23,
             from /usr/local/include/wx-3.1/wx/wx.h:38,
             from /usr/local/include/wx-3.1/wx/wxprec.h:42,
             from ./wx_pch.h:14,
             from <command-line>:0:
/usr/local/include/wx-3.1/wx/gtk/font.h:89:5: note: declared here
 wxFont(int size,
 ^

In my case, I eliminated the warning and the note by changing to a different constructor (though not the one recommended by the warning, which didn't really fit my needs).

awake
  • 1
  • 2