From ace4a7c212c7b399c2dc08dbf846b91f762efe88 Mon Sep 17 00:00:00 2001 From: Ian Sherman Date: Mon, 5 Feb 2024 11:22:05 -0800 Subject: [PATCH] Add workaround for GCC 11 bug related to overload ordering --- components/pango_opengl/include/pangolin/gl/uniform.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/pango_opengl/include/pangolin/gl/uniform.h b/components/pango_opengl/include/pangolin/gl/uniform.h index 031efc441..e53e9f4d4 100644 --- a/components/pango_opengl/include/pangolin/gl/uniform.h +++ b/components/pango_opengl/include/pangolin/gl/uniform.h @@ -8,8 +8,17 @@ namespace pangolin { // Scalar declarations + +// A bug in GCC 11 complains about an ambiguity in the overload set for this function, even though the standard +// is clear that the constrained versions should be selected. +// Reference: +// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111748 +// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102184 +// - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105481 +// By adding a constraint expression, we make it extra clear to GCC that there is no ambiguity. template -void glUniform(GLint location, T val); +void glUniform(GLint location, T val) requires(!sophus::concepts::EigenDenseType && !sophus::concepts::EnumType); + template void glUniform(GLint location, T a, T b); template