[Bug c++/52018] GCC refuses to accept a disambiguation statement
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jan 31 08:24:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52018
--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-01-31 07:33:25 UTC ---
(In reply to comment #1)
> A simple workaround is to introduce a local typename-specifier:
>
> typedef class string c_t;
> h(c_t(42));
or use a static_cast (which has the additional advantage of not allowing a
silent reinterpret_cast):
struct string { string(int); };
enum { string };
void h(struct string);
int main() {
h(static_cast<class string>(42));
}
More information about the Gcc-bugs
mailing list