This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57449] New: name lookup of conversions-function-id differs from clang
- From: "vanyacpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 May 2013 11:27:29 +0000
- Subject: [Bug c++/57449] New: name lookup of conversions-function-id differs from clang
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57449
Bug ID: 57449
Summary: name lookup of conversions-function-id differs from
clang
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
On the code below the behavior of clang and gcc differ. Clang accepts this
code, while gcc reject it:
13.cpp: In function 'int main()':
13.cpp:19:21: error: no matching function for call to 'b::operator int()'
13.cpp:19:21: note: candidate is:
13.cpp:13:5: note: template<class T> b::operator templ<T>()
13.cpp:13:5: note: template argument deduction/substitution failed:
13.cpp:19:21: note: mismatched types 'templ<T>' and 'int'
I don't know which behavior is correct, but the one of clang seems reasonable
to me.
template <typename T>
struct templ
{};
struct a
{
operator int();
};
struct b : a
{
template <typename T>
operator templ<T>();
};
int main()
{
b bb;
bb.operator int();
}