Message ID | BABB605D-098C-444B-85DE-E9782CAE1D0D@comcast.net |
---|---|
State | New |
Headers | show |
On Jun 4, 2012, at 7:46 PM, Mike Stump wrote: > g++.dg/other/warning1.C -std=c++11 (test for warnings, line 10) > g++.dg/other/warning1.C -std=c++11 (test for warnings, line 11) > g++.dg/other/warning1.C -std=c++11 (test for excess errors) > g++.dg/other/warning1.C -std=c++98 (test for warnings, line 10) > g++.dg/other/warning1.C -std=c++98 (test for warnings, line 11) > g++.dg/other/warning1.C -std=c++98 (test for excess errors) So, this one is not obvious. The testcase checks for warning, and the compiler generates an error. Could a C++ maintainer weigh in on it?
On 06/05/2012 12:14 AM, Mike Stump wrote: > On Jun 4, 2012, at 7:46 PM, Mike Stump wrote: >> g++.dg/other/warning1.C -std=c++11 (test for warnings, line 10) >> g++.dg/other/warning1.C -std=c++11 (test for warnings, line 11) >> g++.dg/other/warning1.C -std=c++11 (test for excess errors) >> g++.dg/other/warning1.C -std=c++98 (test for warnings, line 10) >> g++.dg/other/warning1.C -std=c++98 (test for warnings, line 11) >> g++.dg/other/warning1.C -std=c++98 (test for excess errors) > > So, this one is not obvious. The testcase checks for warning, and the compiler generates an error. Could a C++ maintainer weigh in on it? The errors are correct; indeed, we have always given an error for this testcase with -pedantic-errors. It does seem like a diagnostic quality regression that we no longer complain specifically about the division by 0. That regression seems to have happened in 4.3. Since this PR was specifically about the formatting of 1.0f, that should have had its own dg-warning line instead of being lumped in with the initialization error. Jason
Index: testsuite/lib/gcc-dg.exp =================================================================== --- testsuite/lib/gcc-dg.exp (revision 188120) +++ testsuite/lib/gcc-dg.exp (working copy) @@ -766,14 +766,14 @@ proc process-message { msgproc msgprefix # Remove "COLUMN:" from the original expression and move it # to the proper place in the search expression. regsub "^\[0-9\]+:" $expmsg "" expmsg - set expmsg "$column: $msgprefix\[^\n\]*$expmsg" + set expmsg "$column: $msgprefix\[^\n\]*($expmsg)" } elseif [string match "" [lindex $newentry 0]] { # The specified line number is 0; don't expect a column number. - set expmsg "$msgprefix\[^\n\]*$expmsg" + set expmsg "$msgprefix\[^\n\]*($expmsg)" } else { # There is no column number in the search expression, but we # should expect one in the message itself. - set expmsg "\[0-9\]+: $msgprefix\[^\n\]*$expmsg" + set expmsg "\[0-9\]+: $msgprefix\[^\n\]*($expmsg)" } set newentry [lreplace $newentry 2 2 $expmsg]