This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57818] New: A strange template output
- From: "liweifriends at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Jul 2013 08:16:52 +0000
- Subject: [Bug c++/57818] New: A strange template output
- Auto-submitted: auto-generated
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++ ?