]> granicus.if.org Git - clang/commit
[modules] Fix some visibility issues with default template arguments.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 9 Jun 2015 00:35:49 +0000 (00:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 9 Jun 2015 00:35:49 +0000 (00:35 +0000)
commit3d5c8f8827bf601124907a8c69a37e2b412eced8
treee883c5d5946576d52435f8d5c42c1a50ba07b1da
parent5023b4749050cdf0a0957ef2ba27b0150082afdc
[modules] Fix some visibility issues with default template arguments.

There are still problems here, but this is a better starting point.

The main part of the change is: when doing a lookup that would accept visible
or hidden declarations, prefer to produce the latest visible declaration if
there are any visible declarations, rather than always producing the latest
declaration.

Thus, when we inherit default arguments (and other properties) from a previous
declaration, we inherit them from the previous visible declaration; if the
previous declaration is hidden, we already suppress inheritance of default
arguments.

There are a couple of other changes here that fix latent bugs exposed by this
change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239371 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Decl.h
include/clang/AST/DeclBase.h
include/clang/Sema/Lookup.h
lib/AST/DeclBase.cpp
lib/Sema/SemaLookup.cpp
test/Modules/Inputs/template-default-args/a.h [new file with mode: 0644]
test/Modules/Inputs/template-default-args/b.h [new file with mode: 0644]
test/Modules/Inputs/template-default-args/module.modulemap [new file with mode: 0644]
test/Modules/template-default-args.cpp [new file with mode: 0644]