public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype @ 2011-04-15 9:04 daniel.kruegler at googlemail dot com 2011-05-22 19:22 ` [Bug c++/48617] " jason at gcc dot gnu.org ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: daniel.kruegler at googlemail dot com @ 2011-04-15 9:04 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48617 Summary: [C++0x] Problem with non-type template parameters and decltype Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: daniel.kruegler@googlemail.com gcc 4.7.0 in C++0x mode rejects the following program: //--------------- template<class T, decltype(T())> // # struct A {}; A<int, 0> a; int main() {} //--------------- The error message annotated at line # is: "error: 'decltype (T())' is not a valid type for a template constant parameter" It seems to me that according to the FDIS this should be well-formed program: decltype is feasible as a /parameter-declaration/. The new type-equivalence rules in [temp.type] p. 2, "If an expression e involves a template parameter, decltype(e) denotes a unique dependent type. Two such decltype-specifiers refer to the same type only if their expressions are equivalent (14.5.6.1)." should allow for a compiler to deduce the meaning similar to other dependent contexts. See also [temp.dep.type] p. 8 for this matter: "A type is dependent if it is [...] denoted by decltype(expression), where expression is type-dependent (14.6.2.2)." ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48617] [C++0x] Problem with non-type template parameters and decltype 2011-04-15 9:04 [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype daniel.kruegler at googlemail dot com @ 2011-05-22 19:22 ` jason at gcc dot gnu.org 2011-05-23 15:49 ` jason at gcc dot gnu.org ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: jason at gcc dot gnu.org @ 2011-05-22 19:22 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48617 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2011.05.22 19:01:54 CC| |jason at gcc dot gnu.org AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48617] [C++0x] Problem with non-type template parameters and decltype 2011-04-15 9:04 [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype daniel.kruegler at googlemail dot com 2011-05-22 19:22 ` [Bug c++/48617] " jason at gcc dot gnu.org @ 2011-05-23 15:49 ` jason at gcc dot gnu.org 2011-05-25 1:51 ` jason at gcc dot gnu.org ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: jason at gcc dot gnu.org @ 2011-05-23 15:49 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48617 --- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-23 15:32:13 UTC --- Author: jason Date: Mon May 23 15:32:10 2011 New Revision: 174070 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174070 Log: PR c++/48617 * pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE. Added: trunk/gcc/testsuite/g++.dg/cpp0x/decltype27.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48617] [C++0x] Problem with non-type template parameters and decltype 2011-04-15 9:04 [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype daniel.kruegler at googlemail dot com 2011-05-22 19:22 ` [Bug c++/48617] " jason at gcc dot gnu.org 2011-05-23 15:49 ` jason at gcc dot gnu.org @ 2011-05-25 1:51 ` jason at gcc dot gnu.org 2011-05-25 1:57 ` jason at gcc dot gnu.org 2011-06-18 19:16 ` jason at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: jason at gcc dot gnu.org @ 2011-05-25 1:51 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48617 --- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 01:08:10 UTC --- Author: jason Date: Wed May 25 01:08:07 2011 New Revision: 174158 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174158 Log: PR c++/48617 * pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/decltype27.C Modified: branches/gcc-4_6-branch/gcc/cp/ChangeLog branches/gcc-4_6-branch/gcc/cp/pt.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48617] [C++0x] Problem with non-type template parameters and decltype 2011-04-15 9:04 [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype daniel.kruegler at googlemail dot com ` (2 preceding siblings ...) 2011-05-25 1:51 ` jason at gcc dot gnu.org @ 2011-05-25 1:57 ` jason at gcc dot gnu.org 2011-06-18 19:16 ` jason at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: jason at gcc dot gnu.org @ 2011-05-25 1:57 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48617 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED Target Milestone|--- |4.6.1 --- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 01:20:09 UTC --- Fixed for 4.6.1. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48617] [C++0x] Problem with non-type template parameters and decltype 2011-04-15 9:04 [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype daniel.kruegler at googlemail dot com ` (3 preceding siblings ...) 2011-05-25 1:57 ` jason at gcc dot gnu.org @ 2011-06-18 19:16 ` jason at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: jason at gcc dot gnu.org @ 2011-06-18 19:16 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48617 Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jwakely.gcc at gmail dot | |com --- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-18 19:15:09 UTC --- *** Bug 43646 has been marked as a duplicate of this bug. *** ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-06-18 19:16 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-04-15 9:04 [Bug c++/48617] New: [C++0x] Problem with non-type template parameters and decltype daniel.kruegler at googlemail dot com 2011-05-22 19:22 ` [Bug c++/48617] " jason at gcc dot gnu.org 2011-05-23 15:49 ` jason at gcc dot gnu.org 2011-05-25 1:51 ` jason at gcc dot gnu.org 2011-05-25 1:57 ` jason at gcc dot gnu.org 2011-06-18 19:16 ` jason at gcc dot gnu.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).