This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16661] New: class-disambigued explicit c-tor call
- From: "boris at kolpackov dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2004 20:52:31 -0000
- Subject: [Bug c++/16661] New: class-disambigued explicit c-tor call
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat >test.cxx
namespace n
{
struct s
{
s (int i);
};
void
s ();
void
f (struct s const&);
struct s
g ()
{
f (struct s (1));
return struct s (1);
}
}
$ g++ --version
g++ (GCC) 3.4.1
$ g++ -c test.cxx
test.cxx: In function `n::s n::g()':
test.cxx:17: error: expected primary-expression before "struct"
test.cxx:18: error: expected primary-expression before "struct"
test.cxx:18: error: expected `;' before "struct"
test.cxx:18: error: expected primary-expression before "struct"
test.cxx:18: error: expected `;' before "struct"
Rewriting n::g () like this helps
struct s
g ()
{
f ((struct s) (1));
return (struct s) (1);
}
Original example compiles fine with gcc 3.3.4.
--
Summary: class-disambigued explicit c-tor call
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: boris at kolpackov dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-gnu-linux
GCC host triplet: i686-pc-gnu-linux
GCC target triplet: i686-pc-gnu-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16661