Hi all,

I spent some time trying to understand why LilyPond fails to build with
Clang and how a possible fix might look like. TLDR, I've posted a patch
in https://sourceforge.net/p/testlilyissues/issues/5600/ which works on
Linux.

Please find attached another reduced test case: The approach with
'using' (currently in LilyPond's code) only works with GCC, whereas my
proposed solution of re-declaring the base template member compiles
with both GCC and Clang (on Linux).
I'm planning to also test on FreeBSD (which defaults to Clang
nowadays), just don't have time right now. However I don't own Apple
products, so it would be great if somebody could test on macOS...

For context, here are the prior discussions:
 * 
https://lists.gnu.org/archive/html/lilypond-devel/2018-11/msg00019.html
 * http://lists.llvm.org/pipermail/cfe-users/2018-November/001417.html
 * https://bugs.llvm.org/show_bug.cgi?id=39581

Cheers,
Jonas

P.S.: Werner is too fast in discovering new patches 😄
struct Base {
	void f() { }

	template <void (Base::* p)()>
	static void t() {}
};

struct Derived : public Base {
#ifndef FIXED
	using Base::t;
#else
	template <void (Base::* p)()>
	static void t() {}
#endif

	template <void (Derived::* p)()>
	static void t() {}
};

void foo() {
	Derived::t<&Derived::f>();
}

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to