Hi,
On 07/21/2015 06:07 PM, Jason Merrill wrote:
On 07/21/2015 09:02 AM, Paolo Carlini wrote:
I had a look and tried various things... Ultimately the issue is due to
the type_was_error_mark_node becomes integer_type_node trick in
grokdeclarator (which I don't like that much ;)
What happens if we just remove that trick?
Removing it completely (thus essentially unconditionally setting back
type = error_mark_node when type_was_error_mark_node is true) leads to a
few regressions. I tried that earlier today. For cases like
other/nontype-1.C for example we do not handle the second error like the
first one. Thus:
nontype-1.C:3:16: error: ‘Op::first_argument_type’ is not a type
nontype-1.C:4:16: error: ‘Op::second_argument_type’ is not a type
becomes:
nontype-1.C:3:16: error: ‘Op::first_argument_type’ is not a type
nontype-1.C:3:37: error: expected ‘)’ before ‘,’ token
nontype-1.C:3:37: error: expected ‘;’ before ‘,’ token
In other case we get additional "no match for call"-type errors. In the
case of cpp1y/pr65340.C we loose the error message about "use of 'auto'
... before deduction of 'auto'". All in all I think there are a few
tricky cases:
FAIL: g++.dg/cpp0x/alias-decl-33.C -std=c++11 (test for excess errors)
FAIL: g++.dg/cpp0x/alias-decl-33.C -std=c++14 (test for excess errors)
FAIL: g++.dg/cpp1y/pr65340.C -std=c++14 (test for errors, line 15)
FAIL: g++.dg/cpp1y/pr65340.C -std=c++14 (test for excess errors)
FAIL: g++.dg/inherit/error4.C -std=c++98 (test for errors, line 7)
FAIL: g++.dg/inherit/error4.C -std=c++98 (test for excess errors)
FAIL: g++.dg/inherit/error4.C -std=c++11 (test for errors, line 7)
FAIL: g++.dg/inherit/error4.C -std=c++11 (test for excess errors)
FAIL: g++.dg/inherit/error4.C -std=c++14 (test for errors, line 7)
FAIL: g++.dg/inherit/error4.C -std=c++14 (test for excess errors)
FAIL: g++.dg/other/nontype-1.C -std=c++98 (test for errors, line 4)
FAIL: g++.dg/other/nontype-1.C -std=c++98 (test for excess errors)
FAIL: g++.dg/other/nontype-1.C -std=c++11 (test for errors, line 4)
FAIL: g++.dg/other/nontype-1.C -std=c++11 (test for excess errors)
FAIL: g++.dg/other/nontype-1.C -std=c++14 (test for errors, line 4)
FAIL: g++.dg/other/nontype-1.C -std=c++14 (test for excess errors)
FAIL: g++.dg/parse/enum3.C -std=c++98 (test for errors, line 3)
FAIL: g++.dg/parse/enum3.C -std=c++98 (test for excess errors)
FAIL: g++.dg/parse/enum3.C -std=c++11 (test for errors, line 3)
FAIL: g++.dg/parse/enum3.C -std=c++11 (test for excess errors)
FAIL: g++.dg/parse/enum3.C -std=c++14 (test for errors, line 3)
FAIL: g++.dg/parse/enum3.C -std=c++14 (test for excess errors)
FAIL: g++.dg/parse/error3.C -std=gnu++98 (test for excess errors)
FAIL: g++.dg/parse/error3.C -std=gnu++11 (test for excess errors)
FAIL: g++.dg/parse/error3.C -std=gnu++14 (test for excess errors)
FAIL: g++.dg/template/nontype25.C -std=c++98 (test for excess errors)
FAIL: g++.dg/template/nontype25.C -std=c++11 (test for errors, line 10)
FAIL: g++.dg/template/nontype25.C -std=c++14 (test for errors, line 10)
What about applying something like my first patch with a comment that in
principle we would like to extend it carefully to more cases outside
template parameters?
Thanks,
Paolo.