[Geany-Devel] C++11 Bug discussion (transferred from bug tracker)

Lex Trotman elextr at gmail.com
Tue Oct 23 02:58:46 UTC 2012


OOps previous post sent before completion.

On 23 October 2012 12:42, Lex Trotman <elextr at gmail.com> wrote:

>
>
> On 23 October 2012 12:22, Lex Trotman <elextr at gmail.com> wrote:
>
>> Transferred from bug tracker
>> https://sourceforge.net/tracker/?func=detail&aid=3578557&group_id=153444&atid=787791to be easier to handle discussion.
>>
>> Original bug (list)
>>
>> This report is a grab bag of some C++11 things that need fixing so they
>> don't get lost, alpha numbered to refer to as they are fixed. The list is
>> not intended to be exhaustive as I don't use C++11 in anger yet. There are
>> some non-C++11 specific ones I identified as well, some of these are
>> already known but not well bug reported.
>>
>> a. R raw string syntax doesn't highlight
>> b. raw strings containing a " break symbol parsing
>> c. user defined "numeric" literals show as numbers, since they may not be
>> numbers should show as some other highlight
>> d. user defined "string" literals show as strings and the suffix is not
>> highlighted
>> e. operator delete[] does not highlight the []
>> f. forward declared classes not always highlighted as types, seems to
>> need the {}
>> g. declarations class::nested var; insert var into class in symbols
>> h. scope autocompletion on -> should remain after ->*
>> i. [[ ]] attribute syntax not parsed, confuses the parser
>> j. typed enums (eg enum class xxx {};) parsed as classes and erroneously
>> k. enums with base types fixed don't appear in symbols
>> l. namespace aliases parsed as "Other" not namespaces
>> m. declarations namespace::type var; insert var into the namespace on
>> symbols
>> n. deleted member functions not identified in symbols, show as if
>> declared to exist, not to be removed (picky)
>> o. direct initialisations do not show as symbols
>> p. scope autocomplete does not show base class members
>> q. scope autocomplete does not respect access controls on members
>> r. friend declarations are treated as member declarations
>> s. template class parameters not recognised as typenames
>> t. tooltips don't work for template parameters when < is typed
>> u. explicit specialisations break autocompletely
>> v. the documented limitation of not parsing local declarations should be
>> mentioned for completeness
>>
>> Linux Geany 1.23 (git >= eeddd6f), en_AU.UTF-8 : GTK 2.24.10, GLib 2.32.3
>>
>> Most of the items in the attachment were tested to compile (possibly with
>> extra surrounding code) on GCC 4.7.1 (errors in transcription excepted :)
>>
>> Colomban replies:
>>
>> a: fixed, it was "just" a missing mapping for SCE_C_STRINGRAW (how this
>> happened I don't know…)
>>
>
Tests ok for me, thanks.


> c: ok, complete parsing of numbers may help, but it probably would just not
>> highlight the non-numeric suffix (as the string suffixes, your "d" point).
>> Though, note that the current highlighting of numeric constant is
>> perfectly
>> exact from the C preprocessor point of view (last point of
>> http://gcc.gnu.org/onlinedocs/gcc/Incompatibilities.html). BTW, I have a
>> patch for "proper" number parsing I did for the Vala number methods bug.
>>
>
>  Yes, for C, the definition of "preprocessor token" for C++11 has been
> extended to include user defined literals.  Scintilla may need to be fixed
> to distinguish standard numbers from user numbers so we can highlight them
> differently, same for string user literals below.
>
>>
>> d: this is not really fixable, how would you differentiate a
>> "string"MACRO_OR_DEFINE from those C++11 user literals?
>>
>
> As I read C++11 standard thats a user defined literal token, not a string
> token and an identifier token, rather like the number-number example (in
> the gcc doc you referenced above) isn't two numbers subtracted.  Its
> something that may be different between C and C++ and c.c and Lexcpp.cxx
> may need changing to reflect that.
>
>
>>
>> f: ok, quite easy to fix, but having declarations (so without the
>> definition) in the type list may confuse the scope completion code (since
>> the declaration is a perfect match, simply with no children).
>>
>
Yeah, I guess completion has to be taught to ignore tags with no content in
favour of ones with content.


>
>> j and k: fixed in Git
>>
>
Tests ok for me, thanks.


>
>> n: I don't understand this one.
>>
>
Ok, I did say being picky, but it affects autocomplete.  In C++11 you can
delete inherited functions (at least the special member functions, and I
think any one) using a function declaration = delete; syntax.  These
functions are unavailable and shouldn't be in autocomplete, but because
they look like declarations, at the moment, they are in the symbols looking
like normal functions and they are in autocomplete.


>
>> v: nor do I get this one.
>>
>
I was just saying "I know its documented as a limitation, but the fact that
local declarations are not parsed is still a deficiency".  As mentioned on
IRC I have been trying various fixes for this but have gotten nowhere.


Cheers
Lex

> Cheers
>>
>> Lex
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20121023/34a7081a/attachment-0001.html>


More information about the Devel mailing list