summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/captured-statements.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-10-14 12:43:59 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-10-14 12:43:59 +0000
commitbef6aa6ea99b19cbc570a712a4f243398ad7d014 (patch)
treeae038a4f3a52ea27fdd8b71fe9243a0b61dbea8f /clang/test/CodeGenCXX/captured-statements.cpp
parent735f3a26be47c38404608d62eb8c4ace9555e085 (diff)
downloadbcm5719-llvm-bef6aa6ea99b19cbc570a712a4f243398ad7d014.tar.gz
bcm5719-llvm-bef6aa6ea99b19cbc570a712a4f243398ad7d014.zip
Fix for PR30632: Name mangling issue.
There was a bug in the implementation of captured statements. If it has a lambda expression in it and the same lambda expression is used outside the captured region, clang produced an error: ``` error: definition with same mangled name as another definition ``` Here is an example: ``` struct A { template <typename L> void g(const L&) { } }; template<typename T> void f() { { A().g([](){}); } A().g([](){}); } int main() { f<void>(); } ``` Error report: ``` main.cpp:3:10: error: definition with same mangled name as another definition void g(const L&) { } ^ main.cpp:3:10: note: previous definition is here ``` Patch fixes this bug. llvm-svn: 284229
Diffstat (limited to 'clang/test/CodeGenCXX/captured-statements.cpp')
-rw-r--r--clang/test/CodeGenCXX/captured-statements.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/captured-statements.cpp b/clang/test/CodeGenCXX/captured-statements.cpp
index fdda24fcf30..4b95503ad7b 100644
--- a/clang/test/CodeGenCXX/captured-statements.cpp
+++ b/clang/test/CodeGenCXX/captured-statements.cpp
@@ -78,6 +78,7 @@ void test3(int x) {
{
x = [=]() { return x + 1; } ();
}
+ x = [=]() { return x + 1; }();
// CHECK-3: %[[Capture:struct\.anon[\.0-9]*]] = type { i32* }
OpenPOWER on IntegriCloud