New issue
Advanced search Search tips

Issue 842996 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 844392

Blocking:
issue 752720



Sign in to add a comment

Multiple instantiation of a function template with virtual method pointer arguments cause a compile error in C++17

Project Member Reported by tzik@chromium.org, May 15 2018

Issue description

clang-cl fails to compile foo.cc below on C++17 mode.

---- foo.cc
struct Foo {
  virtual void f();
  virtual void g();
};

void Foo::f() {}
void Foo::g() {}

template <void (Foo::*)()>
void h() {}

void x() {
  h<&Foo::f>();
  h<&Foo::g>();
}
----
$ clang-cl /c /std:c++17 foo.cc
foo.cc(10,6):  error: definition with same mangled name as another definition
void h() {}
     ^
foo.cc(10,6):  note: previous definition is here
1 error generated.
----

Specifically in our code, V8Console::call<> instantiations are this pattern.
https://chromium.googlesource.com/v8/v8.git/+/493cfb68b61d5b0a497b625c8440112b00465014/src/inspector/v8-console.cc#706

I'm not sure it's related, but https://bugs.llvm.org/show_bug.cgi?id=27066 may be related. 
 

Comment 1 by tzik@chromium.org, May 15 2018

Blocking: 752720

Comment 2 by tzik@chromium.org, May 16 2018

Moved to a separate issue, https://bugs.llvm.org/show_bug.cgi?id=37481, is this seems unrelated to https://bugs.llvm.org/show_bug.cgi?id=27066.
https://reviews.llvm.org/D46929 is an attempt to fix this.

Comment 3 by thakis@chromium.org, May 18 2018

Blockedon: 844392

Comment 4 by tzik@chromium.org, May 25 2018

Status: Fixed (was: ExternalDependency)

Sign in to add a comment