[Xcb] [Bug 74080] `explicit` is a C++11 keyword, add to _cplusplus_annoyances (with patch)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Feb 21 11:22:01 PST 2014


--- Comment #3 from mike at kmcardiff.com ---
(In reply to comment #1)
> (In reply to comment #0)
> > Created attachment 92810 [details]
> > Patch for c_client.py to fix cpp keywords & lookup error
> > 
> > As said in the summary, `explicit` is a C++11 keyword, which makes (at
> > least) xkb.h fail when included in C++11 sources.
> > Attached is a fix for this ("explicit" => "_explicit" dictionary entry in
> > _cplusplus_annoyances).
> > However, it's unfortunately not done with updating the dict, some lookups
> > for `field.c_type_name` will now fail. Hence, the reverse cpp keyword lookup.
> Hmm, so c++11 just suddenly stole the word 'explicit' and expected
> everything to work out? Unfortunately, you can't change it this way anymore,
> because that would break the API. What you should do is something like this:
> http://cgit.freedesktop.org/xorg/proto/kbproto/tree/XKBstr.
> h?id=5e40da736ffc87f5cafaaa67d745e20ef67a9f4a#n308
> i.e. do the renaming conditionally in the header. I don't think there are
> any old c++ clients using this field, but if there are, hopefully you can
> avoid breaking them as well.
> I guess you can also sidestep the issue entirely by '#define explicit
> _explicit' or so before including xkb.h.

Ran Benita,

I just want to extend/amplify what Mr. Keil says.

The explicit keyword for C++ constructors was in use in the '90's and
standardized in C++98, the first C++ standard.

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20140221/48b7518c/attachment-0001.html>

More information about the Xcb mailing list