mirror of git://gcc.gnu.org/git/gcc.git
				
				
				
			re PR c++/58550 (][c++11] ICE with auto in function return type and lto)
PR c++/58550 * decl.c (grokdeclarator): Turn pedwarn about auto return type in c++11 into error. From-SVN: r207055
This commit is contained in:
		
							parent
							
								
									4bcfd75c03
								
							
						
					
					
						commit
						233aedf4c3
					
				|  | @ -1,5 +1,9 @@ | ||||||
| 2014-01-24  Jason Merrill  <jason@redhat.com> | 2014-01-24  Jason Merrill  <jason@redhat.com> | ||||||
| 
 | 
 | ||||||
|  | 	PR c++/58550 | ||||||
|  | 	* decl.c (grokdeclarator): Turn pedwarn about auto return type in | ||||||
|  | 	c++11 into error. | ||||||
|  | 
 | ||||||
| 	PR c++/59886 | 	PR c++/59886 | ||||||
| 	PR c++/59659 | 	PR c++/59659 | ||||||
| 	* typeck2.c (process_init_constructor_array): Don't create | 	* typeck2.c (process_init_constructor_array): Don't create | ||||||
|  |  | ||||||
|  | @ -9599,9 +9599,14 @@ grokdeclarator (const cp_declarator *declarator, | ||||||
| 			    && LAMBDA_TYPE_P (current_class_type)) | 			    && LAMBDA_TYPE_P (current_class_type)) | ||||||
| 			  /* OK for C++11 lambdas.  */; | 			  /* OK for C++11 lambdas.  */; | ||||||
| 			else if (cxx_dialect < cxx1y) | 			else if (cxx_dialect < cxx1y) | ||||||
| 			  pedwarn (input_location, 0, "%qs function uses " | 			  { | ||||||
|  | 			    error ("%qs function uses " | ||||||
| 				   "%<auto%> type specifier without trailing " | 				   "%<auto%> type specifier without trailing " | ||||||
| 				   "return type", name); | 				   "return type", name); | ||||||
|  | 			    inform (input_location, "deduced return type " | ||||||
|  | 				    "only available with -std=c++1y or " | ||||||
|  | 				    "-std=gnu++1y"); | ||||||
|  | 			  } | ||||||
| 			else if (virtualp) | 			else if (virtualp) | ||||||
| 			  permerror (input_location, "virtual function cannot " | 			  permerror (input_location, "virtual function cannot " | ||||||
| 				     "have deduced return type"); | 				     "have deduced return type"); | ||||||
|  |  | ||||||
|  | @ -0,0 +1,5 @@ | ||||||
|  | // PR c++/58550
 | ||||||
|  | // { dg-options "-std=c++11" }
 | ||||||
|  | 
 | ||||||
|  | auto foo();			// { dg-error "auto" }
 | ||||||
|  | auto fp = foo; | ||||||
		Loading…
	
		Reference in New Issue
	
	 Jason Merrill
						Jason Merrill