public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <20030327144600.10243.mhl.schulze@t-online.de>
@ 2003-07-11 21:14 ` pinskia at physics dot uc dot edu
  2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-11 21:14 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-11 21:14:25
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-11 21:14 -------
Well now on the mainline (20030711), it does say what the template is instantiated as 
because it errors on declaration of the template but you can reproduce this bug with the 
following code:
template <class T> struct test_type { static void dump() {typename T::t a;} };

int i;
int main() {
  int& int_ref = i;
  test_type<typeof(int_ref)>::dump();
}


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <20030327144600.10243.mhl.schulze@t-online.de>
  2003-07-11 21:14 ` [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type pinskia at physics dot uc dot edu
@ 2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
  2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-10-13 23:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |12605
              nThis|                            |


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <20030327144600.10243.mhl.schulze@t-online.de>
  2003-07-11 21:14 ` [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type pinskia at physics dot uc dot edu
  2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
@ 2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
  2004-01-12  6:44 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-10-13 23:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |12604
              nThis|                            |


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <20030327144600.10243.mhl.schulze@t-online.de>
                   ` (2 preceding siblings ...)
  2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
@ 2004-01-12  6:44 ` pinskia at gcc dot gnu dot org
  2004-04-28  1:44 ` pinskia at gcc dot gnu dot org
  2004-07-28 15:06 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-12  6:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-12 06:44 -------
Here is a better example (this should link):
template <class T> struct test_type { static void dump(); };
template <> void  test_type<int&>::dump(){}
int i;
typedef int &t;
int main() {
  int& int_ref = i;
  test_type<t>::dump();
  test_type<typeof(int_ref)>::dump();
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
   Last reconfirmed|2003-07-11 21:14:25         |2004-01-12 06:44:16
               date|                            |


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


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <20030327144600.10243.mhl.schulze@t-online.de>
                   ` (3 preceding siblings ...)
  2004-01-12  6:44 ` pinskia at gcc dot gnu dot org
@ 2004-04-28  1:44 ` pinskia at gcc dot gnu dot org
  2004-07-28 15:06 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-28  1:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-28 00:42 -------
I think the problem is that it is already dereferencing the reference.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-01-12 06:44:16         |2004-04-28 00:42:07
               date|                            |


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


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <20030327144600.10243.mhl.schulze@t-online.de>
                   ` (4 preceding siblings ...)
  2004-04-28  1:44 ` pinskia at gcc dot gnu dot org
@ 2004-07-28 15:06 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-28 15:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
   Last reconfirmed|2004-04-28 00:42:07         |2004-07-28 15:06:21
               date|                            |


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


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <bug-10243-5751@http.gcc.gnu.org/bugzilla/>
  2005-12-24 16:13 ` pinskia at gcc dot gnu dot org
  2005-12-24 16:15 ` pinskia at gcc dot gnu dot org
@ 2005-12-24 21:53 ` giovannibajo at libero dot it
  2 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2005-12-24 21:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from giovannibajo at libero dot it  2005-12-24 21:53 -------
This is by design. It's out typeof() implementation works. It has pros and
cons. See this link (and followups) for papers about this.

http://gcc.gnu.org/ml/gcc/2005-01/msg01642.html


-- 

giovannibajo at libero dot it changed:

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


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


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <bug-10243-5751@http.gcc.gnu.org/bugzilla/>
  2005-12-24 16:13 ` pinskia at gcc dot gnu dot org
@ 2005-12-24 16:15 ` pinskia at gcc dot gnu dot org
  2005-12-24 21:53 ` giovannibajo at libero dot it
  2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-24 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2005-12-24 16:15 -------
An ever better example comes from PR 25555:
#include <iostream>

using std::cerr;
using std::endl;

template <typename X>
struct test
{
  static int const r = 0;
};

template <typename X>
struct test<X&>
{
  static int const r = 1;
};

template <typename X>
struct test<X*>
{
  static int const r = 2;
};

int
main ()
{
  int i;
  int& ri = i;
  cerr << test<typeof (ri)>::r << endl;
}

This should print 1 but instead prints 0.


-- 


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


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

* [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type
       [not found] <bug-10243-5751@http.gcc.gnu.org/bugzilla/>
@ 2005-12-24 16:13 ` pinskia at gcc dot gnu dot org
  2005-12-24 16:15 ` pinskia at gcc dot gnu dot org
  2005-12-24 21:53 ` giovannibajo at libero dot it
  2 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-24 16:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-12-24 16:13 -------
*** Bug 25555 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |boris at kolpackov dot net


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


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

end of thread, other threads:[~2005-12-24 21:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030327144600.10243.mhl.schulze@t-online.de>
2003-07-11 21:14 ` [Bug c++/10243] typeof(expr) yields wrong result if expr has reference type pinskia at physics dot uc dot edu
2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
2003-10-13 23:23 ` reichelt at gcc dot gnu dot org
2004-01-12  6:44 ` pinskia at gcc dot gnu dot org
2004-04-28  1:44 ` pinskia at gcc dot gnu dot org
2004-07-28 15:06 ` pinskia at gcc dot gnu dot org
     [not found] <bug-10243-5751@http.gcc.gnu.org/bugzilla/>
2005-12-24 16:13 ` pinskia at gcc dot gnu dot org
2005-12-24 16:15 ` pinskia at gcc dot gnu dot org
2005-12-24 21:53 ` giovannibajo at libero dot it

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).