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

            Bug ID: 39931
           Summary: False positive on -Wmissing-braces for structure with
                    non-integer subobject
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: pe...@lekensteyn.nl
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

When the first subobject of a structure within another structure is not a
signed integer (e.g. unsigned integer, char, short, long), it triggers a
-Wmissing-braces warning.

Reproducer:

 struct s1 {
    short f1;  // "int f1" is fine.
 };
 struct s2 {
    struct s1 f2;
    int x;
 };
 struct s2 x = {0};
 // warning: suggest braces around initialization of subobject
[-Wmissing-braces]

An earlier issue with the "universal zero initializer" was resolved with bug
21689 (Clang 6), but this one still remains.

Found in:
clang 7.0.0-1 (Arch Linux)
clang version 8.0.0 (trunk 348720) (llvm/trunk 348724)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to