public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57818] New: A strange template output
@ 2013-07-04  8:16 liweifriends at gmail dot com
  2013-07-04  8:40 ` [Bug c++/57818] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: liweifriends at gmail dot com @ 2013-07-04  8:16 UTC (permalink / raw)
  To: gcc-bugs

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++ ?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57818] A strange template output
  2013-07-04  8:16 [Bug c++/57818] New: A strange template output liweifriends at gmail dot com
@ 2013-07-04  8:40 ` paolo.carlini at oracle dot com
  2013-07-04  8:53 ` paolo.carlini at oracle dot com
  2013-07-04  8:57 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04  8:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57818

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-07-04
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57818] A strange template output
  2013-07-04  8:16 [Bug c++/57818] New: A strange template output liweifriends at gmail dot com
  2013-07-04  8:40 ` [Bug c++/57818] " paolo.carlini at oracle dot com
@ 2013-07-04  8:53 ` paolo.carlini at oracle dot com
  2013-07-04  8:57 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04  8:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57818

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |
             Status|NEW                         |UNCONFIRMED
     Ever confirmed|1                           |0

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Oops, not so fast.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57818] A strange template output
  2013-07-04  8:16 [Bug c++/57818] New: A strange template output liweifriends at gmail dot com
  2013-07-04  8:40 ` [Bug c++/57818] " paolo.carlini at oracle dot com
  2013-07-04  8:53 ` paolo.carlini at oracle dot com
@ 2013-07-04  8:57 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04  8:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57818

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
It seems incorrect because you have:

  h<&a>::value

instead of:

  h<&a>::value()


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-04  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04  8:16 [Bug c++/57818] New: A strange template output liweifriends at gmail dot com
2013-07-04  8:40 ` [Bug c++/57818] " paolo.carlini at oracle dot com
2013-07-04  8:53 ` paolo.carlini at oracle dot com
2013-07-04  8:57 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).