[Bug c++/57818] New: A strange template output
liweifriends at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jul 4 08:16:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57818
Bug ID: 57818
Summary: A strange template output
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: liweifriends at gmail dot com
Hi: I have tried the following code in gcc 4.8.1
template<const float* b>
struct h
{
static constexpr float value()
{
return *b;
}
};
constexpr float a = 3.0f;
int main()
{
cout<<a<<endl; //3
cout<<h<&a>::value<<endl; //1
return 0;
}
the output of h<&a>::value seems not correct. Is this a bug? Or just because
the unsupported of C++ ?
More information about the Gcc-bugs
mailing list