Commit 7890246f by Jason Merrill Committed by Jason Merrill

re PR target/43070 (g++.dg/ext/label2.C fails to compile at -O1)

	PR c++/43070
	* semantics.c (finish_goto_stmt): Don't call decay_conversion.

From-SVN: r156872
parent bb7dcd0e
2010-02-18 Jason Merrill <jason@redhat.com> 2010-02-18 Jason Merrill <jason@redhat.com>
PR c++/43070
* semantics.c (finish_goto_stmt): Don't call decay_conversion.
PR c++/26261 PR c++/26261
PR c++/43101 PR c++/43101
* pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope. * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
......
...@@ -546,10 +546,8 @@ finish_goto_stmt (tree destination) ...@@ -546,10 +546,8 @@ finish_goto_stmt (tree destination)
TREE_USED (destination) = 1; TREE_USED (destination) = 1;
else else
{ {
/* The DESTINATION is being used as an rvalue. */
if (!processing_template_decl) if (!processing_template_decl)
{ {
destination = decay_conversion (destination);
destination = cp_convert (ptr_type_node, destination); destination = cp_convert (ptr_type_node, destination);
if (error_operand_p (destination)) if (error_operand_p (destination))
return NULL_TREE; return NULL_TREE;
......
2010-02-18 Jason Merrill <jason@redhat.com> 2010-02-18 Jason Merrill <jason@redhat.com>
PR c++/43070
* g++.dg/ext/label1.C: Update.
* g++.dg/ext/label2.C: Update.
PR c++/26261 PR c++/26261
* g++.dg/template/dependent-name6.C: New. * g++.dg/template/dependent-name6.C: New.
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
int main(void) { int main(void) {
static const void* lbls[2][2] = {{&&lbl0, &&lbl0}, {&&lbl0, &&lbl0}}; static const void* lbls[2][2] = {{&&lbl0, &&lbl0}, {&&lbl0, &&lbl0}};
goto *lbls[0]; goto *lbls[0][0];
goto *lbls[0][0][0]; // { dg-message "" }
goto *lbls[0]; // { dg-error "" }
lbl0: lbl0:
; ;
} }
...@@ -5,7 +5,7 @@ void f() { ...@@ -5,7 +5,7 @@ void f() {
l: l:
void *p[] = { &&l }; void *p[] = { &&l };
goto *p; goto *p[0];
} }
template void f<int>(); template void f<int>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment