diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-09-26 04:34:21 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-09-26 04:34:21 +0000 |
commit | 80bfa3d125fa0b9c636977ea37b4a55b2c9b1037 (patch) | |
tree | 34b2d495913dcff65c8a6cb3ea02c97d5af56ca2 /test/CodeGenCXX/mangle-lambdas.cpp | |
parent | d7a6b1640e565487d163023a6a2e83f55476ae96 (diff) |
Fix an edge case of mangling involving the combination of a lambda and typeid.
typeid (and a couple other non-standard places where we can transform an
unevaluated expression into an evaluated expression) is special
because it introduces an an expression evaluation context,
which conflicts with the mechanism to compute the current
lambda mangling context. PR12123.
I would appreciate if someone would double-check that we get the mangling
correct with this patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164658 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-lambdas.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle-lambdas.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-lambdas.cpp b/test/CodeGenCXX/mangle-lambdas.cpp index 979760dab9..0bd5ad2a02 100644 --- a/test/CodeGenCXX/mangle-lambdas.cpp +++ b/test/CodeGenCXX/mangle-lambdas.cpp @@ -172,6 +172,19 @@ template<typename...T> int PR12917<T...>::n[3] = { PR12917<int, char, double> pr12917; int *pr12917_p = PR12917<int, int>::n; +namespace std { + struct type_info; +} +namespace PR12123 { + struct A { virtual ~A(); } g; + struct B { + void f(const std::type_info& x = typeid([]()->A& { return g; }())); + void h(); + }; + void B::h() { f(); } +} +// CHECK: define linkonce_odr %"struct.PR12123::A"* @_ZZN7PR121231B1fERKSt9type_infoEd_NKUlvE_clEv + namespace PR12808 { template <typename> struct B { int a; |