[LLVMbugs] [Bug 20573] New: field designator 'a' does not refer to a non-static data member

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 6 22:48:53 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20573

            Bug ID: 20573
           Summary: field designator 'a' does not refer to a non-static
                    data member
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jani.lahtinen at stonesoft.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code:

struct foo
{
  int a;
};

struct bar
{
  struct foo;
};

struct bar b =
{
  .a = 0
};

int main(int argc, char **argv)
{
  return 0;
}

Fails to compile with:

clang -g -O0 -fms-extensions -Wno-microsoft $FFLAGS -Werror -c $IFLAGS -o tst.o
tst.c
tst.c:13:4: error: field designator 'a' does not refer to a non-static data
      member
  .a = 0
   ^
tst.c:3:7: note: field designator refers here
  int a;
      ^
1 error generated.

However this:

struct bar b =
{
};

int main(int argc, char **argv)
{
  b.a = 0;
  return 0;
}

Compiles without errors.

-- 
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/20140807/b1e1ed09/attachment.html>


More information about the llvm-bugs mailing list