[all-commits] [llvm/llvm-project] 538762: Better diagnostics for anonymous bit-fields with a...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Sep 29 13:32:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 538762fef0b662048be2a261ebc12da249efa977
      https://github.com/llvm/llvm-project/commit/538762fef0b662048be2a261ebc12da249efa977
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2020-09-29 (Tue, 29 Sep 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/CXX/class/class.bit/p1.cpp
    M clang/test/Parser/MicrosoftExtensions.cpp
    M clang/test/Parser/c2x-attributes.c

  Log Message:
  -----------
  Better diagnostics for anonymous bit-fields with attributes or an initializer.

The current C++ grammar allows an anonymous bit-field with an attribute,
but this is ambiguous (the attribute in that case could appertain to the
type instead of the bit-field). The current thinking in the Core Working
Group is that it's better to disallow attributes in that position at the
grammar level so that the ambiguity resolves in favor of applying to the
type.

During discussions about the behavior of the attribute, the Core Working
Group also felt it was better to disallow anonymous bit-fields from
specifying a default member initializer.

This implements both sets of related grammar changes.




More information about the All-commits mailing list