[llvm-bugs] [Bug 38272] New: Include MainRegex not working with <...>

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 23 01:59:35 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38272

            Bug ID: 38272
           Summary: Include MainRegex not working with <...>
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gnuetzi at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 20588
  --> https://bugs.llvm.org/attachment.cgi?id=20588&action=edit
format settings

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 normall we would use quotes "" instead of
angles <> for the main include).

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180723/ab021f72/attachment.html>


More information about the llvm-bugs mailing list