[PATCH] D80977: Diagnose cases where the name of a class member is used within a class definition before the member name is declared.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 1 22:09:23 PDT 2020


rsmith created this revision.
rsmith added a reviewer: rnk.
Herald added a project: clang.

This is ill-formed per [basic.scope.class]p2.

This is done by tracking all unqualified lookups performed within the
scope of a class definition that find nothing within the class, and
checking for conflicting declarations later introduced into the class.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80977

Files:
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Lookup.h
  clang/include/clang/Sema/Scope.h
  clang/include/clang/Sema/SemaInternal.h
  clang/lib/Parse/ParseCXXInlineMethods.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Sema/Scope.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/lib/Sema/SemaExprCXX.cpp
  clang/lib/Sema/SemaLookup.cpp
  clang/lib/Sema/SemaTemplate.cpp
  clang/test/CXX/basic/basic.scope/basic.scope.class/p2.cpp
  clang/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
  clang/test/CXX/drs/dr2xx.cpp
  clang/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp
  clang/test/Parser/cxx-ambig-init-templ.cpp
  clang/test/Parser/cxx0x-override-control-keywords.cpp
  clang/test/SemaTemplate/alias-templates.cpp
  clang/test/SemaTemplate/deduction-crash.cpp
  clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
  clang/test/SemaTemplate/ms-delayed-default-template-args.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80977.267786.patch
Type: text/x-patch
Size: 42143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200602/72aeedf9/attachment-0001.bin>


More information about the cfe-commits mailing list