[all-commits] [llvm/llvm-project] bd5b22: Fix TryParsePtrOperatorSeq.

michele-scandale via All-commits all-commits at lists.llvm.org
Mon Feb 24 05:08:54 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bd5b22070b6984d89c13b6cf38c3e54fc98ce291
      https://github.com/llvm/llvm-project/commit/bd5b22070b6984d89c13b6cf38c3e54fc98ce291
  Author: Michele Scandale <michele.scandale at gmail.com>
  Date:   2020-02-24 (Mon, 24 Feb 2020)

  Changed paths:
    M clang/include/clang/Parse/Parser.h
    M clang/lib/Parse/ParseTentative.cpp
    M clang/test/CXX/dcl.decl/p4-0x.cpp
    M clang/test/Parser/cxx-ambig-decl-expr.cpp
    M clang/test/Parser/cxx-attributes.cpp

  Log Message:
  -----------
  Fix TryParsePtrOperatorSeq.

The syntax rules for ptr-operator allow attributes after *, &,
&&, therefore we should be able to parse the following:

void fn() {
    void (*[[attr]] x)() = &fn;
    void (&[[attr]] y)() = fn;
    void (&&[[attr]] z)() = fn;
}
However the current logic in TryParsePtrOperatorSeq does not consider
the presence of attributes leading to unexpected parsing errors.

Moreover we should also consider _Atomic a possible qualifier that can
appear after the sequence of attribute specifiers.




More information about the All-commits mailing list