[modules] PR28812: Modules can return duplicate field decls.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 26 Oct 2016 10:24:29 +0000 (10:24 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Wed, 26 Oct 2016 10:24:29 +0000 (10:24 +0000)
commite53a4b7402ed311d06e25adfce44b6d12b7c89b1
treeea984b2bb66c5451fdfb77110aa7335799f6c79d
parentdf5042ab613a71d0fee0e1ac8a36a22b1f8bc241
[modules] PR28812: Modules can return duplicate field decls.

If two modules contain duplicate class definitions the lookup result can contain
more than 2 elements. Sift the lookup results until we find a field decl.

It is not necessary to do ODR checks in place as they done elsewhere.

This should fix issues when compiling with libstdc++ 5.2 and 6.2.

Patch developed in collaboration with Richard Smith!

llvm-svn: 285184
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/Modules/Inputs/PR28812/Textual.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR28812/a.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR28812/b.h [new file with mode: 0644]
clang/test/Modules/Inputs/PR28812/module.modulemap [new file with mode: 0644]
clang/test/Modules/pr28812.cpp [new file with mode: 0644]