* [Bug c++/47950] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
@ 2011-03-02 15:39 ` dev.lists at jessamine dot co.uk
2011-03-02 16:08 ` [Bug c++/47950] [4.6 Regression] " redi at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dev.lists at jessamine dot co.uk @ 2011-03-02 15:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
Adam Butcher <dev.lists at jessamine dot co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dev.lists at jessamine dot
| |co.uk, jason at gcc dot
| |gnu.org
--- Comment #1 from Adam Butcher <dev.lists at jessamine dot co.uk> 2011-03-02 15:39:00 UTC ---
Added Jason to CC.
Rolling back to my previous HEAD reveals that the reduced example above still
fails whereas the code I was originally trying to build worked. So obviously
my reduction has changed something. It doesn't change the fact that there is
an internal compiler error with the example above but it does mean that maybe
it is less likely to be hit.
So I was wrong that the above code has regressed in the last few days. The
code that I was originally trying to build, which did work a few days ago and
now fails with the symptoms described above was using BOOST_FOREACH. Obviously
this is unnecessary in C++0x as there is for(:) but it was compiling fine
before (and does in an old GCC 4.5 I have in C++0x mode).
The boost example was a non-dependent boost.foreach in a function template:
#include <vector>
#include <boost/foreach.hpp>
template <typename T>
void f()
{
std::vector<int> v = { 1,2,3,4 };
BOOST_FOREACH(int x, v)
{
}
}
int main()
{
f<int>();
}
Making the vector dependent on T rather than int makes the problem go away. I
arrived at the reduction stated previously by breaking down BOOST_FOREACH until
the failure occurred.
Clearly there is an issue here but I'll do a bit more investigation into why
the boost example worked a few builds ago and why my reduction doesn't.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/47950] [4.6 Regression] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
2011-03-02 15:39 ` [Bug c++/47950] " dev.lists at jessamine dot co.uk
@ 2011-03-02 16:08 ` redi at gcc dot gnu.org
2011-03-02 16:30 ` dev.lists at jessamine dot co.uk
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-02 16:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.03.02 16:07:53
Summary|[C++0x] Internal compiler |[4.6 Regression] [C++0x]
|error: non-dependent |Internal compiler error:
|declaration as condition |non-dependent declaration
|causes |as condition causes
|tsubst_copy_and_build |tsubst_copy_and_build
|assertion failure. |assertion failure.
Ever Confirmed|0 |1
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-02 16:07:53 UTC ---
(In reply to comment #1)
> So I was wrong that the above code has regressed in the last few days.
Confirmed, it fails with 4.6.0 20110219 too, but not in c++98 mode or with 4.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/47950] [4.6 Regression] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
2011-03-02 15:39 ` [Bug c++/47950] " dev.lists at jessamine dot co.uk
2011-03-02 16:08 ` [Bug c++/47950] [4.6 Regression] " redi at gcc dot gnu.org
@ 2011-03-02 16:30 ` dev.lists at jessamine dot co.uk
2011-03-02 22:46 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dev.lists at jessamine dot co.uk @ 2011-03-02 16:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
--- Comment #3 from Adam Butcher <dev.lists at jessamine dot co.uk> 2011-03-02 16:30:30 UTC ---
(In reply to comment #1)
>
> Rolling back to my previous HEAD reveals that the reduced example above still
> fails whereas the code I was originally trying to build worked. So obviously
> my reduction has changed something.
>
Okay. My original reduction was okay but I also added additional examples that
yielded the same assertion failure (obviously via different route!). The
function-call case following is the one that causes the failure in
non-dependent use of boost.foreach on the latest 4.6 HEAD. It compiles okay on
my 4.6 build from last week (prior to 170488).
if (from_int<int> x = via_function(7))
;
The constructor cases below have failed for a much longer time (though are okay
in 4.5).
if (empty<int> x = empty<int>())
;
if (from_int<int> x = from_int<int>(7))
;
So the only recent regression is the function-call case. But all cases are all
still legitimate 4.5 -> 4.6 regressions.
Before rev 170488 (25th Feb) the function-call case compiled.
I don't know when the constructor cases stopped working -- I went quite a way
back and they still failed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/47950] [4.6 Regression] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
` (2 preceding siblings ...)
2011-03-02 16:30 ` dev.lists at jessamine dot co.uk
@ 2011-03-02 22:46 ` jason at gcc dot gnu.org
2011-03-03 2:49 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-02 22:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/47950] [4.6 Regression] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
` (3 preceding siblings ...)
2011-03-02 22:46 ` jason at gcc dot gnu.org
@ 2011-03-03 2:49 ` jason at gcc dot gnu.org
2011-03-03 8:47 ` dev.lists at jessamine dot co.uk
2011-03-03 16:51 ` jason at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-03 2:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-03 02:49:30 UTC ---
Author: jason
Date: Thu Mar 3 02:49:28 2011
New Revision: 170639
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170639
Log:
PR c++/47950
* parser.c (cp_parser_condition): Don't fold_non_dependent_expr here.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/regress/condition1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/47950] [4.6 Regression] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
` (4 preceding siblings ...)
2011-03-03 2:49 ` jason at gcc dot gnu.org
@ 2011-03-03 8:47 ` dev.lists at jessamine dot co.uk
2011-03-03 16:51 ` jason at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: dev.lists at jessamine dot co.uk @ 2011-03-03 8:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
Adam Butcher <dev.lists at jessamine dot co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #5 from Adam Butcher <dev.lists at jessamine dot co.uk> 2011-03-03 08:47:09 UTC ---
Great. Full build of our tree works from clean with latest 4.6 HEAD now.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/47950] [4.6 Regression] [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.
2011-03-02 11:21 [Bug c++/47950] New: [C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure dev.lists at jessamine dot co.uk
` (5 preceding siblings ...)
2011-03-03 8:47 ` dev.lists at jessamine dot co.uk
@ 2011-03-03 16:51 ` jason at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-03 16:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47950
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-03 16:51:23 UTC ---
Author: jason
Date: Thu Mar 3 16:51:20 2011
New Revision: 170656
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170656
Log:
PR c++/47950
* pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 8+ messages in thread