[PATCH] D25216: Improve error message when referencing a non-tag type with a tag

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 17:22:18 PDT 2016


rnk created this revision.
rnk added a reviewer: rsmith.
rnk added a subscriber: cfe-commits.

Other compilers accept invalid code here that we reject, and we need a
better error message to try to convince users that the code is really
incorrect. Consider:

  class Foo {
    typedef MyIterHelper<Foo> iterator;
    friend class iterator;
  };

Previously our wording was "elaborated type refers to a typedef".
"elaborated type" isn't widely known terminology, so the new diagnostic
tries to talk about tag types.


https://reviews.llvm.org/D25216

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaTemplate.cpp
  lib/Sema/TreeTransform.h
  test/CXX/basic/basic.lookup/basic.lookup.elab/p2.cpp
  test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.elab/p2-0x.cpp
  test/CXX/drs/dr2xx.cpp
  test/CXX/drs/dr4xx.cpp
  test/CXX/temp/temp.decls/temp.friend/p1.cpp
  test/CXX/temp/temp.spec/no-body.cpp
  test/SemaCXX/PR8755.cpp
  test/SemaCXX/using-decl-templates.cpp
  test/SemaTemplate/template-id-expr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25216.73380.patch
Type: text/x-patch
Size: 9911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161004/b790b0a9/attachment.bin>


More information about the cfe-commits mailing list