diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-03-26 22:27:09 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-03-26 22:27:09 +0000 |
| commit | ffbf705cc3656566d0f3ed710a860baa3eba1b85 (patch) | |
| tree | 56bd8ac3ef802f61c82aaade07d087a8a69da2ce /clang/test | |
| parent | 97112eeeffebd8212ea7bee0a469589261d3abba (diff) | |
| download | bcm5719-llvm-ffbf705cc3656566d0f3ed710a860baa3eba1b85.tar.gz bcm5719-llvm-ffbf705cc3656566d0f3ed710a860baa3eba1b85.zip | |
[Modules] Fix a sneaky bug in r233249 where we would look for implicit
constructors in the current lexical context even though name lookup
found them via some other context merged into the redecl chain.
This can only happen for implicit constructors which can only have the
name of the type of the current context, so we can fix this by simply
*always* merging those names first. This also has the advantage of
removing the walk of the current lexical context from the common case
when this is the only constructor name we need to deal with (implicit or
otherwise).
I've enhanced the tests to cover this case (and uncovered an unrelated
bug which I fixed in r233325).
llvm-svn: 233327
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Modules/Inputs/stress1/m01.h | 4 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/stress1/merge00.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/stress1/m01.h b/clang/test/Modules/Inputs/stress1/m01.h index d0b150a7382..23a3d4b289f 100644 --- a/clang/test/Modules/Inputs/stress1/m01.h +++ b/clang/test/Modules/Inputs/stress1/m01.h @@ -3,4 +3,8 @@ #include "common.h" +// Trigger the use of special members for a class this is also defined in other +// modules. +inline N00::S01 m01_special_members() { return N00::S01(); } + #endif diff --git a/clang/test/Modules/Inputs/stress1/merge00.h b/clang/test/Modules/Inputs/stress1/merge00.h index fc1b4f81188..46d5e413827 100644 --- a/clang/test/Modules/Inputs/stress1/merge00.h +++ b/clang/test/Modules/Inputs/stress1/merge00.h @@ -9,6 +9,7 @@ //#pragma weak pragma_weak01 // expected-warning {{weak identifier 'pragma_weak01' never declared}} //#pragma weak pragma_weak04 // expected-warning {{weak identifier 'pragma_waek04' never declared}} +#include "common.h" #include "m00.h" #include "m01.h" #include "m02.h" @@ -16,6 +17,10 @@ inline int g() { return N00::S00('a').method00('b') + (int)S00(42) + function00(42); } +// Use implicit special memebers again for S01 to ensure that we merge them in +// successfully from m01. +inline N00::S01 h() { return N00::S01(); } + #pragma weak pragma_weak02 #pragma weak pragma_weak05 |

