[llvm-bugs] [Bug 34003] New: Unspecified behavior - 'typedef enum' and 'extern'

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 31 07:48:49 PDT 2017


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

            Bug ID: 34003
           Summary: Unspecified behavior - 'typedef enum' and 'extern'
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bubyofficial at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Unspecified behavior: different formatting rules if there is enum declaration
directly before 'typedef enum' or 'extern'.

Configuration of clang-format.
BraceWrapping: AfterEnum is set to true. 
Code:

// BEFORE:
extern "C" {
#include <IfAaSysLog.h>
}

typedef enum { a, b, c } MyEnum;

enum SomeEnum
{
    AAA = 1,
    BBB = 2,
}

extern "C" {
#include <IfAaSysLog.h>
}

enum SomeEnum
{
    AAA = 1,
    BBB = 2,
}

typedef enum { a, b, c } MyEnum;



//AFTER:
extern "C" {
#include <IfAaSysLog.h>
}

typedef enum { a, b, c } MyEnum;

enum SomeEnum
{
    AAA = 1,
    BBB = 2,
}

extern "C"
{
#include <IfAaSysLog.h>
}

enum SomeEnum
{
    AAA = 1,
    BBB = 2,
}

typedef enum
{
    a,
    b,
    c
} MyEnum;

-- 
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/20170731/949a8849/attachment-0001.html>


More information about the llvm-bugs mailing list