Two solutions to my understanding may be used:ġ. I think because of the rules of the argument dependent lookup (ADL) the compiler finds both overloads and cannot continue to decide to select the proper one. Return octave::builtin_name (interp, args, nargout) Octave::builtin_name (octave::interpreter&, const octave_value_list& = octave_value_list (), int = 0) įor each builtin an inline function is defined in that header that calls the correct function and is marked as deprecated like this :īuiltin_name (octave::interpreter& interp, const octave_value_list& args = octave_value_list (), int nargout = 0) It appears that it only has affected the builtins that have the following signature: oct files that are calling builtin functions via including "builtin-defun-decls.h".
I don't know if we like to use the work-around with the template. We probably don't want to remove the original functions (without namespace) without any grace period. Or by explicitly calling the function in the octave namespace:īut I'd guess the intention was that the deprecated function wrapper used in the original example should be working, too. Octave::interpreter& interp = *octave::interpreter::the_interpreter () The error can be avoided, e.g., by moving the entire function into the octave namespace: ::interpreter&, const octave_value_list&, int)'ĥ3 | F_dump_load_path_ (octave::interpreter&, const octave_value_list& = octave_value_list (), int = 0) Rpreter&, const octave_value_list&, int)'Ģ530 | F_dump_load_path_ (octave::interpreter& interp, const octave_value_list& args = octave_value_list (), int nargout = 0)Ĭ:\progra~1\gnuoct~1\octave~1.90\mingw64\include\octave-7.0.90\octave\builtin-defun-decls.h:53:1: note: candidate: 'octave_value_list octave::F_dump_load_path_(octave :12:20: error: call of overloaded 'F_dump_load_path_(octave::interpreter&)' is ambiguousĬ:\progra~1\gnuoct~1\octave~1.90\mingw64\include\octave-7.0.90\octave\builtin-defun-decls.h:2530:1: note: candidate: 'octave_value_list F_dump_load_path_(octave::inte : In function 'octave_value_list Flpath(const octave_value_list&, int)': Am I doing something wrong? It's not particularly useful to lose the warning since we would like users to be alerted to this namespace change. The warning about the deprecated function name also disappeared. However, when I changed the inline function in builtin-defun-decls.h to be Using a template (or some other method that works to avoid the ambiguity) could be OK. We want to provide the old names to allow for a transition period of at least two major releases so removing the old names in version 7 is not really an option. The intent was to move all of these built-in functions inside the octave namespace while also providing inline functions that would also make them visible in the global namespace. Should we support compiling without GNU extensions? It only compiles if I enable GNU extensions (e.g. While playing around with this, I noticed the following:ĭ:\svn\octave\test\octave-20-55-w64 of-general\octave-20-55-w64\mingw64\include\octave-8.0.0\octave\oct-cmplx.h: In function 'bool operator>=(T, const std::complex&)':ĭ:\svn\octave\test\octave-20-55-w64 of-general\octave-20-55-w64\mingw64\include\octave-8.0.0\octave\oct-cmplx.h:99:39: error: 'M_PI' was not declared in this scopeĭ:\svn\octave\test\octave-20-55-w64 of-general\octave-20-55-w64\mingw64\include\octave-8.0.0\octave\oct-cmplx.h:236:1: note: in expansion of macro 'DEF_COMPLEXR_COMP'Įrror: mkoctfile: building exited with failure status
OCTAVE_DEPRECATED (7, "use 'octave::F_dump_load_path_' instead")į_dump_load_path_ (octave::interpreter& interp, const octave_value_list& args = octave_value_list (), int nargout = 0) Return octave::F_dump_load_path_ (interp, args, nargout) Octave_value_list (*f_ptr) (T&, const octave_value_list&, int) Is this a compiler bug?į_dump_load_path_ (T& interp, const octave_value_list& args = octave_value_list (), int nargout = 0) But only if the wrapper template is creating a pointer to that function first. The following change in `builtin-defun-decls.h` makes the deprecation warning show for me. But the warning is only shown if they are used at least twice(?). It looks like function templates can't be deprecated.