Skip to content

do have anybody a test file for the option sp_paren_paren? #1342

Closed

Description

@guy-maurel

Making many tests with the version current, I cannot find any scenario where this option is active.
Can anybody help?

Activity

  1. CDanU commented on Sep 15, 2017

    @CDanU
    Collaborator

    Looking at the old SVN Repo this option comes with the very fist commit:

    Import release 0.0.5 
    CommitDate: Thu Feb 23 00:20:18 2006 +0000
    

    At that point in time the lang enum was defined this way:

    enum
    {
       LANG_C   = 1,
       LANG_CPP = 2,
       LANG_D   = 4,
       LANG_ALL = 7,
    
       FLAG_PP = 0x80,  /*<< only appears in a preprocessor */
    };

    Also see GCC Attribute Syntax

  2. guy-maurel commented on Sep 15, 2017

    @guy-maurel
    ContributorAuthor

    Using the example void f(int (__attribute__((foo)) x)) {}
    the option is not used, because the case is catch by the option sp_inside_fparen
    log_rule2(119): Spacing: line 1 [FPAREN_OPEN/FUNC_DEF] '(' <===> [CPP_CAST/NONE] 'int' : sp_inside_fparen[1274] ...
    Any proposal?

  3. CDanU commented on Sep 15, 2017

    @CDanU
    Collaborator

    I guess the option is not working then.
    sp_paren_paren should be triggered if both ( tokens are compared, only than the check for ( foo is done.
    It might be caused because of the parenthesis types, one of the is an FPAREN_OPEN and the other one just PAREN_OPEN.

    I think that the FPAREN_OPEN parenthesis should be some other (maybe new) type entirely. See thee noexcept parenthesis ( we don't handle those yet, see here)
    Alternatively make the option work with a mix of FPAREN_* and PAREN_* sp_paren_paren overwrite (activate before) sp_inside_fparen .

  4. guy-maurel commented on Sep 18, 2017

    @guy-maurel
    ContributorAuthor

    #1348 is a proposal to make the option active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions