[LLVMbugs] [Bug 12008] New: Confusing error message with declared constexpr member functions
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Feb 15 02:14:53 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=12008
Bug #: 12008
Summary: Confusing error message with declared constexpr member
functions
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++0x
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: marc.mutz at kdab.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 8053
--> http://llvm.org/bugs/attachment.cgi?id=8053
Test program (as pasted in the report)
Code:
class Point {
constexpr Point( int x, int y )
: x( x ), y( y ) {}
public:
static constexpr Point fromXY( int x, int y );
private:
int x, y;
};
constexpr Point Point::fromXY( int x, int y )
{ return Point( x, y ); }
GCC groks this, but Clang (probably correctly) rejects it, but with a confusing
error message:
test.cpp:11:24: error: conflicting types for 'fromXY'
constexpr Point Point::fromXY( int x, int y )
^
test.cpp:5:28: note: previous declaration is here
static constexpr Point fromXY( int x, int y );
^
1 error generated.
A better error message would be "constexpr functions must be defined where
first declared", assuming that's what the above error message tried to tell me.
--
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