This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52018] GCC refuses to accept a disambiguation statement
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 31 Jan 2012 07:33:25 +0000
- Subject: [Bug c++/52018] GCC refuses to accept a disambiguation statement
- Auto-submitted: auto-generated
- References: <bug-52018-4@http.gcc.gnu.org/bugzilla/>
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));
}