HomePhabricator

Fix for PR30632: Name mangling issue.

Authored by ABataev on Oct 14 2016, 5:43 AM.

Description

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

Details

Committed
ABataevOct 14 2016, 5:43 AM
Parents
rG735f3a26be47: Removed duplicate header include
Branches
Unknown
Tags
Unknown