[PATCH] D60892: Modules: Search for a visible definition of the decl context when computing visibility of a default template parameter

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 18 15:46:16 PDT 2019


dblaikie created this revision.
dblaikie added a reviewer: rsmith.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The code is/was already correct for the case where a parameter is a
parameter of its enclosing lexical DeclContext (functions and classes).
But for other templates (alias and variable templates) they don't create
their own scope to be members of - in those cases, they parameter should
be considered visible if any definition of the lexical decl context is
visible.

[this should cleanup the failure on the libstdc++ modules buildbot]
[this doesn't actually fix the variable template case for a
secondary/compounding reason (its lexical decl context is incorrectly
considered to be the translation unit)]

Test covers all 4 kinds of templates with default args, including a
regression test for the still broken variable template case.


Repository:
  rC Clang

https://reviews.llvm.org/D60892

Files:
  lib/Sema/SemaLookup.cpp
  test/Modules/Inputs/nested-template-default-arg-redecl/alias.h
  test/Modules/Inputs/nested-template-default-arg-redecl/alias1.h
  test/Modules/Inputs/nested-template-default-arg-redecl/alias2.h
  test/Modules/Inputs/nested-template-default-arg-redecl/func.h
  test/Modules/Inputs/nested-template-default-arg-redecl/func1.h
  test/Modules/Inputs/nested-template-default-arg-redecl/func2.h
  test/Modules/Inputs/nested-template-default-arg-redecl/module.modulemap
  test/Modules/Inputs/nested-template-default-arg-redecl/strct.h
  test/Modules/Inputs/nested-template-default-arg-redecl/strct1.h
  test/Modules/Inputs/nested-template-default-arg-redecl/strct2.h
  test/Modules/Inputs/nested-template-default-arg-redecl/var.h
  test/Modules/Inputs/nested-template-default-arg-redecl/var1.h
  test/Modules/Inputs/nested-template-default-arg-redecl/var2.h
  test/Modules/nested-template-default-arg-redecl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60892.195825.patch
Type: text/x-patch
Size: 6373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190418/de954f5e/attachment.bin>


More information about the cfe-commits mailing list