public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression
@ 2010-07-19 22:34 hstong at ca dot ibm dot com
2010-07-19 23:03 ` [Bug c++/44996] [C++0x] " redi at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: hstong at ca dot ibm dot com @ 2010-07-19 22:34 UTC (permalink / raw)
To: gcc-bugs
The expression '(y)' below that constitutes the operand to decltype is neither
an unparenthesized id-expression, a class member access, a function call nor an
invocation of an overloaded operator.
Based on the wording in FCD 14882 (WG21 N3092), this parenthesized
id-expression has type int and is an lvalue. The type of decltype((y))
is then 'int &'.
The following test case demonstrates that GCC is finding the type to be
'int &&'. The test case is meant to compile clean.
### Self-contained source (dataa.cpp):
extern int &&y;
typedef int &myIntRef;
typedef decltype((y)) myIntRef;
### Command to reproduce:
g++ -std=c++0x -c dataa.cpp
### Compiler output:
dataa.cpp:3:23: error: conflicting declaration 'typedef int&& myIntRef'
dataa.cpp:2:14: error: 'myIntRef' has a previous declaration as 'typedef int&
myIntRef'
### g++ -v output:
Using built-in specs.
Target: powerpc64-unknown-linux-gnu
Configured with: ../gcc-4.5.0/configure --prefix=/data/gcc
--program-suffix=-4.5.0 --disable-libssp --disable-libgcj
--enable-version-specific-runtime-libs --with-cpu=default32 --enable-secureplt
--with-long-double-128 --enable-shared --enable-__cxa_atexit
--enable-threads=posix --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.5.0 (GCC)
--
Summary: decltype produces rvalue reference type for
parenthesized id-expression
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hstong at ca dot ibm dot com
GCC host triplet: powerpc64-unknown-linux-gnu
GCC target triplet: powerpc64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44996
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44996] [C++0x] decltype produces rvalue reference type for parenthesized id-expression
2010-07-19 22:34 [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression hstong at ca dot ibm dot com
@ 2010-07-19 23:03 ` redi at gcc dot gnu dot org
2010-07-20 0:56 ` jason at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-19 23:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from redi at gcc dot gnu dot org 2010-07-19 23:03 -------
yup, Jason confirmed this is a gcc bug on the std reflector
--
redi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-07-19 23:03:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44996
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44996] [C++0x] decltype produces rvalue reference type for parenthesized id-expression
2010-07-19 22:34 [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression hstong at ca dot ibm dot com
2010-07-19 23:03 ` [Bug c++/44996] [C++0x] " redi at gcc dot gnu dot org
@ 2010-07-20 0:56 ` jason at gcc dot gnu dot org
2010-07-20 1:32 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-20 0:56 UTC (permalink / raw)
To: gcc-bugs
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2010-07-19 23:03:41 |2010-07-20 00:56:26
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44996
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44996] [C++0x] decltype produces rvalue reference type for parenthesized id-expression
2010-07-19 22:34 [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression hstong at ca dot ibm dot com
2010-07-19 23:03 ` [Bug c++/44996] [C++0x] " redi at gcc dot gnu dot org
2010-07-20 0:56 ` jason at gcc dot gnu dot org
@ 2010-07-20 1:32 ` jason at gcc dot gnu dot org
2010-07-20 3:31 ` jason at gcc dot gnu dot org
2010-07-20 3:31 ` jason at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-20 1:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jason at gcc dot gnu dot org 2010-07-20 01:32 -------
Subject: Bug 44996
Author: jason
Date: Tue Jul 20 01:31:42 2010
New Revision: 162323
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162323
Log:
PR c++/44996
* semantics.c (finish_decltype_type): Correct decltype
of parenthesized rvalue reference variable.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/decltype23.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44996
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44996] [C++0x] decltype produces rvalue reference type for parenthesized id-expression
2010-07-19 22:34 [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression hstong at ca dot ibm dot com
` (2 preceding siblings ...)
2010-07-20 1:32 ` jason at gcc dot gnu dot org
@ 2010-07-20 3:31 ` jason at gcc dot gnu dot org
2010-07-20 3:31 ` jason at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-20 3:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jason at gcc dot gnu dot org 2010-07-20 03:31 -------
Subject: Bug 44996
Author: jason
Date: Tue Jul 20 03:31:29 2010
New Revision: 162324
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162324
Log:
PR c++/44996
* semantics.c (finish_decltype_type): Correct decltype
of parenthesized rvalue reference variable.
Added:
branches/gcc-4_5-branch/gcc/testsuite/g++.dg/cpp0x/decltype23a.C
Modified:
branches/gcc-4_5-branch/gcc/cp/ChangeLog
branches/gcc-4_5-branch/gcc/cp/semantics.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44996
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/44996] [C++0x] decltype produces rvalue reference type for parenthesized id-expression
2010-07-19 22:34 [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression hstong at ca dot ibm dot com
` (3 preceding siblings ...)
2010-07-20 3:31 ` jason at gcc dot gnu dot org
@ 2010-07-20 3:31 ` jason at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-07-20 3:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jason at gcc dot gnu dot org 2010-07-20 03:31 -------
Fixed for 4.5.1.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.5.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44996
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-07-20 3:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 22:34 [Bug c++/44996] New: decltype produces rvalue reference type for parenthesized id-expression hstong at ca dot ibm dot com
2010-07-19 23:03 ` [Bug c++/44996] [C++0x] " redi at gcc dot gnu dot org
2010-07-20 0:56 ` jason at gcc dot gnu dot org
2010-07-20 1:32 ` jason at gcc dot gnu dot org
2010-07-20 3:31 ` jason at gcc dot gnu dot org
2010-07-20 3:31 ` jason at gcc dot gnu dot org
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).