[Bug c++/77840] New: List-initialization and copy-constructor
wolfgang.roehrl@gi-de.com
gcc-bugzilla@gcc.gnu.org
Tue Oct 4 06:18:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77840
Bug ID: 77840
Summary: List-initialization and copy-constructor
Product: gcc
Version: 6.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: wolfgang.roehrl@gi-de.com
Target Milestone: ---
Hi,
I would like to post a bug report for the GNU C/C++ compiler 6.1.1.
We use the compiler to generate code for a PowerPC processor.
Invokation line for the GNU C compiler:
ccppc -c -x c -std=gnu11 -Wall -Werror -g -mcpu=e6500 -m32
-maltivec -mvrsave -ftls-model=local-exec -msdata=sysv
-fno-common -fno-openmp -mbig -mmultiple -mno-string -misel
-mstrict-align -fverbose-asm -G 8 -O3
-I<some include paths>
-D<some #define's>
X.C -oX.O
// file X.C
struct X
{
X (int);
X (const X&) = delete;
};
X arrX = { 1, 2, 3 };
The compiler rejects this program because the copy constructor is
deleted. But according to the C++11 standard this initialization
should not involve a copy/move constructor (cf. 12.6.1/2).
By the way, the compiler accepts a slighty different programm:
// file X.C
struct X
{
X (int);
X (const X&) = delete;
};
X arrX[] = { {1}, {2}, {3} };
With kind regards
W. Roehrl
More information about the Gcc-bugs
mailing list