[LLVMbugs] [Bug 9336] New: Incorrect attaching of const
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Feb 26 10:47:19 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9336
Summary: Incorrect attaching of const
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: chris at bubblescope.net
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Created an attachment (id=6244)
--> (http://llvm.org/bugs/attachment.cgi?id=6244)
Example code
The attached file fails to compile in clang++. It compiles in both g++ and
comeau.
I attach the backtrace below. I'll be honest, I'm not 100% sure who is in the
right. This was reduced from a boost testcase (in boost assign). I can't see
how the "inner" const is sneaking in.
t.cc:10:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
t.cc:21:24: note: in instantiation of function template specialization
'generic_list<generic_list<int> >::operator array<array<array<int> > >'
requested here
array<array<int> > a = l;
^
t.cc:9:10: error: read-only variable is not assignable
ar[0]=*i;
~~~~~^
t.cc:9:11: note: in instantiation of function template specialization
'generic_list<int>::operator array<const array<int> >' requested here
ar[0]=*i;
^
t.cc:21:24: note: in instantiation of function template specialization
'generic_list<generic_list<int> >::operator array<array<array<int> > >'
requested here
array<array<int> > a = l;
^
1 warning and 1 error generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list