Skip to content

Commit

Permalink
Add workaround for GCC 11 bug related to overload ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Sherman committed Feb 5, 2024
1 parent ea62590 commit ace4a7c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/pango_opengl/include/pangolin/gl/uniform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
void glUniform(GLint location, T val);
void glUniform(GLint location, T val) requires(!sophus::concepts::EigenDenseType<T> && !sophus::concepts::EnumType<T>);

template <typename T>
void glUniform(GLint location, T a, T b);
template <typename T>
Expand Down

0 comments on commit ace4a7c

Please sign in to comment.