* [Bug c++/52725] error: capture of non-variable (in regards to a variable)
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
@ 2012-03-26 15:46 ` redi at gcc dot gnu.org
2012-05-25 11:10 ` steffen_moeller at gmx dot de
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2012-03-26 15:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-26 15:43:59 UTC ---
It works if you remove the parentheses, which also makes the code valid C++
(currently it relies on a GNU extension that allows a variable array size for a
parenthesised new expression, you get a warning with -pedantic or -Wvla)
It seems that there's some interaction between the C++11 lambda parsing and the
GNU extension
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] error: capture of non-variable (in regards to a variable)
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
2012-03-26 15:46 ` [Bug c++/52725] " redi at gcc dot gnu.org
@ 2012-05-25 11:10 ` steffen_moeller at gmx dot de
2012-05-25 11:30 ` [Bug c++/52725] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression redi at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: steffen_moeller at gmx dot de @ 2012-05-25 11:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Steffen Möller <steffen_moeller at gmx dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |steffen_moeller at gmx dot
| |de
--- Comment #2 from Steffen Möller <steffen_moeller at gmx dot de> 2012-05-25 10:33:51 UTC ---
Hello, I have something similar in the OpenMM code
(https://simtk.org/home/openmm), with no ()s following the "new" as in
template <typename T>
struct CUDAStream : public SoADeviceObject
{
unsigned int _length;
unsigned int _subStreams; # line 68
unsigned int _stride;
T** _pSysStream;
T** _pDevStream;
T* _pSysData;
T* _pDevData;
std::string _name;
CUDAStream(int length, int subStreams = 1, std::string name="");
CUDAStream(unsigned int length, unsigned int subStreams = 1, std::string
name="");
CUDAStream(unsigned int length, int subStreams = 1, std::string name="");
CUDAStream(int length, unsigned int subStreams = 1, std::string name="");
virtual ~CUDAStream();
void Allocate();
void Deallocate();
void Upload();
void Download();
void CopyFrom(const CUDAStream<T>& src);
void Collapse(unsigned int newstreams = 1, unsigned int interleave = 1);
T& operator[](int index);
};
[...]
template <typename T>
void CUDAStream<T>::Allocate()
{
cudaError_t status;
_pSysStream = new T*[_subStreams]; # line 125
_pDevStream = new T*[_subStreams];
_pSysData = new T[_subStreams * _stride];
status = cudaMalloc((void **) &_pDevData, _stride * _subStreams *
sizeof(T));
RTERROR(status, (_name+": cudaMalloc in CUDAStream::Allocate
failed").c_str());
for (unsigned int i = 0; i < _subStreams; i++)
{
_pSysStream[i] = _pSysData + i * _stride;
_pDevStream[i] = _pDevData + i * _stride;
}
}
for which 4.6.3 (Debian 4.6.3-5) happily crunches but 4.7 (Debian 4.7.0-9)
gives me
cd
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/obj-x86_64-linux-gnu/platforms/cuda/sharedTarget
&& /usr/local/bin/c++ -DOpenMMCuda_EXPORTS -DOPENMM_LIBRARY_NAME=OpenMM
-DOPENMM_MAJOR_VERSION=1 -DOPENMM_MINOR_VERSION=0 -DOPENMM_BUILD_VERSION=0
-DOPENMM_SVN_REVISION=\"exported\" -DOPENMM_COPYRIGHT_YEARS=\"2008\"
-DOPENMM_AUTHORS=\"Peter.Eastman\" -O3 -DNDEBUG -fPIC
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/src
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/./include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/src
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/libraries/validate/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/reference/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/libraries/lbfgs/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/libraries/sfmt/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/libraries/lepton/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/libraries/quern/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/libraries/jama/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/olla/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/openmmapi/include
-I/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/./include
-DOPENMMCUDA_BUILDING_SHARED_LIBRARY -o
CMakeFiles/OpenMMCuda.dir/__/__/__/src/cuda/kApplyConstraints.cu_OpenMMCuda_generated.cpp.o
-c
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/obj-x86_64-linux-gnu/src/cuda/kApplyConstraints.cu_OpenMMCuda_generated.cpp
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/./src/kernels//cudatypes.h:
In member function ‘virtual void CUDAStream<T>::Allocate()’:
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/./src/kernels//cudatypes.h:125:27:
error: capture of non-variable ‘CUDAStream<T>::_subStreams’
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/./src/kernels//cudatypes.h:68:10:
note: ‘unsigned int CUDAStream<T>::_subStreams’ declared here
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/./src/kernels//cudatypes.h:126:27:
error: capture of non-variable ‘CUDAStream<T>::_subStreams’
/homeLvm/moeller/alioth/debichem/experimental/openmm-4.1/platforms/cuda/./src/kernels//cudatypes.h:68:10:
note: ‘unsigned int CUDAStream<T>::_subStreams’ declared here
make[3]: ***
[platforms/cuda/sharedTarget/CMakeFiles/OpenMMCuda.dir/__/__/__/src/cuda/kApplyConstraints.cu_OpenMMCuda_generated.cpp.o]
Error 1
Thanks and regards,
Steffen
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
2012-03-26 15:46 ` [Bug c++/52725] " redi at gcc dot gnu.org
2012-05-25 11:10 ` steffen_moeller at gmx dot de
@ 2012-05-25 11:30 ` redi at gcc dot gnu.org
2012-05-29 10:34 ` steffen_moeller at gmx dot de
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-25 11:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|error: capture of |error: "capture of
|non-variable (in regards to |non-variable" for
|a variable) |new-expression incorrectly
| |parsed as lambda-expression
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-25 11:09:37 UTC ---
N.B. I've changed the Summary, the "non-variable" in the diagnostic refers to a
non-automatic variable, in this case a data member, which isn't allowed in a
lamdba capture. The problem is not that the error says a member variable is a
non-variable, it's that a new-expression is mistaken for a lambda-expresion.
(In reply to comment #2)
> Hello, I have something similar in the OpenMM code
> (https://simtk.org/home/openmm), with no ()s following the "new" as in
Please provide a minimal, complete example, those snippets do not allow your
report to be reproduced or confirmed. This seems to be equivalent but works
fine:
template <typename T>
struct CUDAStream
{
unsigned int _subStreams;
T** _pSysStream;
void Allocate();
};
template <typename T>
void CUDAStream<T>::Allocate()
{
_pSysStream = new T*[_subStreams];
}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (2 preceding siblings ...)
2012-05-25 11:30 ` [Bug c++/52725] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression redi at gcc dot gnu.org
@ 2012-05-29 10:34 ` steffen_moeller at gmx dot de
2012-05-29 11:34 ` steffen_moeller at gmx dot de
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: steffen_moeller at gmx dot de @ 2012-05-29 10:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
--- Comment #4 from Steffen Möller <steffen_moeller at gmx dot de> 2012-05-29 10:33:36 UTC ---
Hello, this took me a while.
It seems like the problem is in (or in the interaction with) nvcc, the NVidia
compiler. For that you program for the graphics card and the host processor at
the same time. The .cu files indicate such files that are not meant to be seen
by the regular compiler at a first sight. It then generates preprocessed files
for gcc to digest.
$ rm -f t.cu_OpenMMCuda_generated.cpp; /usr/bin/nvcc t.cu -cuda -o
t.cu_OpenMMCuda_generated.cpp && g++ -c t.cu_OpenMMCuda_generated.cpp
t.cu: In member function ‘void CUDAStream<T>::Allocate()’:
t.cu:12:27: error: capture of non-variable ‘CUDAStream<T>::_subStreams’
t.cu:4:10: note: ‘unsigned int CUDAStream<T>::_subStreams’ declared here
$ cat t.cu
template <typename T>
struct CUDAStream
{
unsigned int _subStreams;
T** _pSysStream;
void Allocate();
};
template <typename T>
void CUDAStream<T>::Allocate()
{
_pSysStream = new T*[_subStreams];
}
The NVCC-generated code now has the ()s again:
# 9 "t.cu"
template< class T> void
# 10 "t.cu"
CUDAStream< T> ::Allocate()
# 11 "t.cu"
{
# 12 "t.cu"
(_pSysStream) = (new (T *[_subStreams]));
# 13 "t.cu"
}
4.6 crunges it, 4.7 does not. Sounds like we should prepare an email to NVidia.
Anybody with any direct contacts?
Thanks
Steffen
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (3 preceding siblings ...)
2012-05-29 10:34 ` steffen_moeller at gmx dot de
@ 2012-05-29 11:34 ` steffen_moeller at gmx dot de
2012-05-29 11:56 ` [Bug c++/52725] [4.7/4.8 Regression] " redi at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: steffen_moeller at gmx dot de @ 2012-05-29 11:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
--- Comment #5 from Steffen Möller <steffen_moeller at gmx dot de> 2012-05-29 11:31:04 UTC ---
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Thu_Apr__5_00:24:31_PDT_2012
Cuda compilation tools, release 4.2, V0.2.1221
as shipping with Debian unstable in package version 4.2.9-1.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (4 preceding siblings ...)
2012-05-29 11:34 ` steffen_moeller at gmx dot de
@ 2012-05-29 11:56 ` redi at gcc dot gnu.org
2012-05-29 12:03 ` redi at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-29 11:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-05-29
Known to work| |4.1.2, 4.4.3, 4.6.3
Summary|error: "capture of |[4.7/4.8 Regression] error:
|non-variable" for |"capture of non-variable"
|new-expression incorrectly |for new-expression
|parsed as lambda-expression |incorrectly parsed as
| |lambda-expression
Ever Confirmed|0 |1
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-29 11:55:06 UTC ---
Anything to do with the cuda compiler is irrelevant here, this report is for a
GCC bug not for other programs, even if they generate code that triggers the
bug.
Anyway, I'm confirming this, here's a reduced testcase that produces a slightly
different eror, due to using a global instead of a data member:
struct A { };
extern int n;
void f()
{
A** p = new (A*[n]);
}
Accepted by 4.6 and earlier, rejected by 4.7 and later
$ g++-4.7 -c t.cc
t.cc: In function 'void f()':
t.cc:7:21: warning: capture of variable 'n' with non-automatic storage duration
[enabled by default]
t.cc:3:5: note: 'int n' declared here
N.B. 4.5 says
t.cc: In function ‘void f()’:
t.cc:7:19: warning: lambda expressions only available with -std=c++0x or
-std=gnu++0x
But that was fixed for 4.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (5 preceding siblings ...)
2012-05-29 11:56 ` [Bug c++/52725] [4.7/4.8 Regression] " redi at gcc dot gnu.org
@ 2012-05-29 12:03 ` redi at gcc dot gnu.org
2012-05-29 14:33 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-29 12:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-29 11:59:26 UTC ---
(In reply to comment #6)
> N.B. 4.5 says
>
> t.cc: In function ‘void f()’:
> t.cc:7:19: warning: lambda expressions only available with -std=c++0x or
> -std=gnu++0x
>
> But that was fixed for 4.6
I tested 4.5.2, that should be fixed in 4.5.3, see Bug 46159 and its dup Bug
47651
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (6 preceding siblings ...)
2012-05-29 12:03 ` redi at gcc dot gnu.org
@ 2012-05-29 14:33 ` rguenth at gcc dot gnu.org
2012-06-01 17:03 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-29 14:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Target Milestone|--- |4.7.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (7 preceding siblings ...)
2012-05-29 14:33 ` rguenth at gcc dot gnu.org
@ 2012-06-01 17:03 ` jason at gcc dot gnu.org
2012-06-01 21:19 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-01 17:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (8 preceding siblings ...)
2012-06-01 17:03 ` jason at gcc dot gnu.org
@ 2012-06-01 21:19 ` jason at gcc dot gnu.org
2012-06-01 21:20 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-01 21:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:19:26 UTC ---
Author: jason
Date: Fri Jun 1 21:19:22 2012
New Revision: 188127
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188127
Log:
PR c++/52725
* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
Added:
trunk/gcc/testsuite/g++.dg/parse/new6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (9 preceding siblings ...)
2012-06-01 21:19 ` jason at gcc dot gnu.org
@ 2012-06-01 21:20 ` jason at gcc dot gnu.org
2012-06-01 21:20 ` jason at gcc dot gnu.org
2012-06-01 21:21 ` jason at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-01 21:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:19:26 UTC ---
Author: jason
Date: Fri Jun 1 21:19:22 2012
New Revision: 188127
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188127
Log:
PR c++/52725
* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
Added:
trunk/gcc/testsuite/g++.dg/parse/new6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:19:42 UTC ---
Author: jason
Date: Fri Jun 1 21:19:36 2012
New Revision: 188128
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188128
Log:
PR c++/52725
* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/parse/new6.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/parser.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:20:19 UTC ---
Fixed for 4.7.1.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (10 preceding siblings ...)
2012-06-01 21:20 ` jason at gcc dot gnu.org
@ 2012-06-01 21:20 ` jason at gcc dot gnu.org
2012-06-01 21:21 ` jason at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-01 21:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:19:26 UTC ---
Author: jason
Date: Fri Jun 1 21:19:22 2012
New Revision: 188127
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188127
Log:
PR c++/52725
* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
Added:
trunk/gcc/testsuite/g++.dg/parse/new6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:19:42 UTC ---
Author: jason
Date: Fri Jun 1 21:19:36 2012
New Revision: 188128
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188128
Log:
PR c++/52725
* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/parse/new6.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/parser.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/52725] [4.7/4.8 Regression] error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression
2012-03-26 15:31 [Bug c++/52725] New: error: capture of non-variable (in regards to a variable) lahart.joseph at gmail dot com
` (11 preceding siblings ...)
2012-06-01 21:20 ` jason at gcc dot gnu.org
@ 2012-06-01 21:21 ` jason at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-01 21:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52725
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:19:42 UTC ---
Author: jason
Date: Fri Jun 1 21:19:36 2012
New Revision: 188128
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188128
Log:
PR c++/52725
* parser.c (cp_parser_binary_expression): Bail early if we're parsing
tentatively and the LHS has a parse error.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/parse/new6.C
Modified:
branches/gcc-4_7-branch/gcc/cp/ChangeLog
branches/gcc-4_7-branch/gcc/cp/parser.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-01 21:20:19 UTC ---
Fixed for 4.7.1.
^ permalink raw reply [flat|nested] 14+ messages in thread