public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57943] New: [c++11] invalid decltype expression accepted in template default type
@ 2013-07-20 22:16 f.heckenbach@fh-soft.de
2020-05-14 17:05 ` [Bug c++/57943] " ppalka at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: f.heckenbach@fh-soft.de @ 2013-07-20 22:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57943
Bug ID: 57943
Summary: [c++11] invalid decltype expression accepted in
template default type
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: f.heckenbach@fh-soft.de
The following program compiles and apparently defaults T as a, altough a (0) is
not a valid expression.
struct a { };
template <typename T = decltype (a (0))> void f () { }
int main ()
{
// decltype (a (0)) x; // correctly rejected
f ();
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/57943] [c++11] invalid decltype expression accepted in template default type
2013-07-20 22:16 [Bug c++/57943] New: [c++11] invalid decltype expression accepted in template default type f.heckenbach@fh-soft.de
@ 2020-05-14 17:05 ` ppalka at gcc dot gnu.org
2020-05-15 23:34 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-05-14 17:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57943
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
CC| |ppalka at gcc dot gnu.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/57943] [c++11] invalid decltype expression accepted in template default type
2013-07-20 22:16 [Bug c++/57943] New: [c++11] invalid decltype expression accepted in template default type f.heckenbach@fh-soft.de
2020-05-14 17:05 ` [Bug c++/57943] " ppalka at gcc dot gnu.org
@ 2020-05-15 23:34 ` cvs-commit at gcc dot gnu.org
2020-05-15 23:36 ` ppalka at gcc dot gnu.org
2020-07-24 18:40 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-15 23:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57943
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:115232b778943be075fc4df991e03d9387563114
commit r11-434-g115232b778943be075fc4df991e03d9387563114
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri May 15 18:51:11 2020 -0400
c++: decltype of invalid non-dependent expr [PR57943]
We sometimes fail to reject an invalid non-dependent operand to decltype
when inside a template, because finish_decltype_type resolves the
decltype to the TREE_TYPE of the operand before we ever instantiate and
fully process the operand. Fix this by adding a call to
instantiate_non_dependent_expr_sfinae in finish_decltype_type.
gcc/cp/ChangeLog:
PR c++/57943
* semantics.c (finish_decltype_type): Call
instantiate_non_dependent_expr_sfinae on the expression.
gcc/testsuite/ChangeLog:
PR c++/57943
* g++.dg/cpp0x/decltype76.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/57943] [c++11] invalid decltype expression accepted in template default type
2013-07-20 22:16 [Bug c++/57943] New: [c++11] invalid decltype expression accepted in template default type f.heckenbach@fh-soft.de
2020-05-14 17:05 ` [Bug c++/57943] " ppalka at gcc dot gnu.org
2020-05-15 23:34 ` cvs-commit at gcc dot gnu.org
@ 2020-05-15 23:36 ` ppalka at gcc dot gnu.org
2020-07-24 18:40 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-05-15 23:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57943
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/57943] [c++11] invalid decltype expression accepted in template default type
2013-07-20 22:16 [Bug c++/57943] New: [c++11] invalid decltype expression accepted in template default type f.heckenbach@fh-soft.de
` (2 preceding siblings ...)
2020-05-15 23:36 ` ppalka at gcc dot gnu.org
@ 2020-07-24 18:40 ` cvs-commit at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-24 18:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57943
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:048ba9c02db7ee461abe86a37544fcd4e0cf8858
commit r11-2308-g048ba9c02db7ee461abe86a37544fcd4e0cf8858
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri Jul 24 14:31:36 2020 -0400
c++: Add testcase for [PR81339]
We correctly reject this testcase since r11-434, i.e. since the fix for
PR c++/57943.
gcc/testsuite/ChangeLog:
PR c++/81339
* g++.dg/cpp0x/decltype78.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-24 18:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-20 22:16 [Bug c++/57943] New: [c++11] invalid decltype expression accepted in template default type f.heckenbach@fh-soft.de
2020-05-14 17:05 ` [Bug c++/57943] " ppalka at gcc dot gnu.org
2020-05-15 23:34 ` cvs-commit at gcc dot gnu.org
2020-05-15 23:36 ` ppalka at gcc dot gnu.org
2020-07-24 18:40 ` cvs-commit 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).