http://llvm.org/bugs/show_bug.cgi?id=8773
Summary: Poor diagnostics and error recovery for templated
method call on mis-declared class member
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
$ cat ~/llvm/testcases/bad_templated_method_call.cc
class Bar;
class Baz {
void f() {
obj.method<Bar>();
}
Foo obj;
};
$ clang -fsyntax-only ~/llvm/testcases/bad_templated_method_call.cc
/home/matthewbg/llvm/testcases/bad_templated_method_call.cc:6:3: error: unknown
type name 'Foo'
Foo obj;
^
/home/matthewbg/llvm/testcases/bad_templated_method_call.cc:4:16: error: 'Bar'
does not refer to a value
obj.method<Bar>();
^
/home/matthewbg/llvm/testcases/bad_templated_method_call.cc:1:7: note: declared
here
class Bar;
^
/home/matthewbg/llvm/testcases/bad_templated_method_call.cc:4:21: error:
expected expression
obj.method<Bar>();
^
3 errors generated.
=====
Having "obj.method<Bar>();" parsed as an arithmetic expression is really
confusing. It would be nice if there were some better recovery here. Also, if
'obj' is a local instead of a class member, it incurs a "use of undeclared
identifier" error at the start of the method call statement, which helps point
out what's wrong.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs