Skip to content

Commit 5995745

Browse files
committed
better error message when overrider cannot be matched to method
1 parent 33c6569 commit 5995745

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) 2018-2025 Jean-Louis Leroy
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// See accompanying file LICENSE_1_0.txt
4+
// or copy at http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#include <boost/openmethod.hpp>
7+
8+
using boost::openmethod::virtual_;
9+
10+
struct Animal {};
11+
struct Dog : Animal {};
12+
13+
// Deliberately omit BOOST_OPENMETHOD(speak, ...) to trigger the static_assert.
14+
15+
BOOST_OPENMETHOD_CLASSES(Animal, Dog);
16+
17+
BOOST_OPENMETHOD_OVERRIDE(speak, (virtual_<Dog&>), void) {
18+
}
19+
20+
int main() {
21+
return 0;
22+
}

0 commit comments

Comments
 (0)