Bug 57532 - [4.8/4.9 regression] operator& broken when used on rvalues
Summary: [4.8/4.9 regression] operator& broken when used on rvalues
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.1
: P3 normal
Target Milestone: 4.8.2
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-05 07:09 UTC by Matthias Kretz (Vir)
Modified: 2013-08-05 21:38 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.7.2, 4.8.0
Known to fail: 4.8.1, 4.9.0
Last reconfirmed: 2013-06-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kretz (Vir) 2013-06-05 07:09:20 UTC
int main()
{
    return (int() & int());
}

compile with g++ -O0 -o test main.cpp

this compiles with all compilers I know, except GCC 4.8.1
Comment 1 Richard Biener 2013-06-05 08:54:53 UTC
Confirmed.
Comment 2 Jakub Jelinek 2013-06-05 17:04:18 UTC
Yeah, starting with r197315 we warned about it, r198730 fixed that (no warning nor error), and r198842 started reporting error instead on this.
Comment 3 Jason Merrill 2013-07-09 18:51:58 UTC
Fixed for 4.8.2/4.9.
Comment 4 Salamanderrake 2013-07-31 16:38:36 UTC
Is there a patch to get this working with gcc 4.8.1? How far back into the history will the patch need to reach.
Comment 5 Paolo Carlini 2013-07-31 16:48:38 UTC
Just search gcc-patches around the date of Comment #3, no? http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00372.html
Comment 6 Salamanderrake 2013-08-04 18:21:00 UTC
I will have to patch it up to that point from gcc 4.8.1 to Comment #3, is the main repo git or subversion?
Comment 7 Salamanderrake 2013-08-04 18:31:58 UTC
What I should have asked is what revision is gcc 4.8.1 and what revision was the fix put into trunk?
Comment 8 Jason Merrill 2013-08-05 21:38:20 UTC
(In reply to Salamanderrake from comment #7)
> What I should have asked is what revision is gcc 4.8.1 and what revision was
> the fix put into trunk?

svn log svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch
svn log svn://gcc.gnu.org/svn/gcc/tags/gcc_4_8_1_release

show that the fix went into the branch at r200836, and the release was at r199525.  You can extract the patch from SVN with

svn diff -c200836 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch

It doesn't depend on anything else since the 4.8.1 release.