Multiple instantiation of a function template with virtual method pointer arguments cause a compile error in C++17 |
|||
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.
,
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.
,
May 18 2018
,
May 25 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by tzik@chromium.org
, May 15 2018