Skip to content

Include MainRegex not working with <...> #37620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
llvmbot opened this issue Jul 23, 2018 · 0 comments
Open

Include MainRegex not working with <...> #37620

llvmbot opened this issue Jul 23, 2018 · 0 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@llvmbot
Copy link
Member

llvmbot commented Jul 23, 2018

Bugzilla Link 38272
Version trunk
OS Windows NT
Attachments format settings
Reporter LLVM Bugzilla Contributor

Extended Description

Having the following includes in a File "BTest.h" :

#include "StdAfx.h"
#include <BTest.h> /// MAIN INCLUDE
#include <ATest.h>  

and the attached clang-format rules: excerpt here:

IncludeCategories: 
  - Regex:           '^[<"]StdAfx'
    Priority:        -1
  - Regex:           '^<.*>'
    Priority:        2
  - Regex:           '.*'
    Priority:        3
IncludeIsMainRegex: '$'

The output sorts like:

#include "StdAfx.h"
#include <ATest.h>
#include <BTest.h>  /// MAIN INCLUDE

which is kind of wrong (even though normally we would use quotes "" instead of angles <> for the main include).

This only happens with "<BTest.h>" not with with the quotes: '"BTest.h"'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

1 participant