[LLVMbugs] [Bug 12758] New: miscompilation of calls to __attribute__((pure)) virtual functions
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon May 7 14:51:46 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=12758
Bug #: 12758
Summary: miscompilation of calls to __attribute__((pure))
virtual functions
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: richard-llvm at metafoo.co.uk
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Consider this code:
struct B { virtual void f() __attribute__((pure)); };
struct D : B { void f(); };
void f(B *p) { p->f(); }
void g() { D b; f(&b); }
Here, B::f() is __attribute__((pure)), but D::f() is not. g++ emits a virtual
call within ::f(), but Clang does not. Likewise, g++ emits a call to D::f()
within ::g(), but Clang does not.
The GCC docs don't explicitly state what should happen here, but they do say
that 'pure' is a property of the function itself, which suggests that g++ is
right and clang is wrong.
--
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.
More information about the llvm-bugs
mailing list