http://llvm.org/bugs/show_bug.cgi?id=7395
Summary: clang does not reject invalid conversion from method
to bool
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
gcc rejects the following code, but clang does not:
(kreme...@gruebook:tmp)$ cat t.cpp
#include <assert.h>
class Foo {
public:
void set() {}
void test() {
assert(set);
}
};
(kreme...@gruebook:tmp)$ gcc -c t.cpp
t.cpp: In member function ‘void Foo::test()’:
t.cpp:7: error: could not convert ‘((Foo*)this)->Foo::set’ to ‘bool’
t.cpp:7: error: in argument to unary !
(kreme...@gruebook:tmp)$ clang -c t.cpp
(kreme...@gruebook:tmp)$
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs