This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52018] GCC refuses to accept a disambiguation statement


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));
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]