FunctionRef: Strip cv qualifiers in the converting constructor
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Mar 2020 23:28:35 +0000 (16:28 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Mar 2020 23:31:58 +0000 (16:31 -0700)
commitcbce88dd3a9ea7161da3c57749cf03873dc7ea79
treed9cbf7c3c7363d0840e3349d6422ec3b92495b8a
parentd68c09ac87959694fbb4895ff49443afc2b582f9
FunctionRef: Strip cv qualifiers in the converting constructor

Without this some instances of copy construction would use the
converting constructor & lead to the destination function_ref referring
to the source function_ref instead of the underlying functor.

Discovered in feedback from 857bf5da35af8e1f9425e1865dab5f5fce5e38f2

Thanks to Johannes Doerfert, Arthur O'Dwyer, and Richard Smith for the
discussion and debugging.
llvm/include/llvm/ADT/STLExtras.h
llvm/unittests/ADT/FunctionRefTest.cpp