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: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs