http://llvm.org/bugs/show_bug.cgi?id=12019
Bug #: 12019
Summary: Typo-correcting invalid redecl causes infinite mutual
recursion between two methods
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
In the test case:
class foo {
inline void set_types(int index, int value);
inline void add_types(int value);
};
class bar: public foo {};
void foo::set_topic(const char* topic) {}
void bar::set_topic(const char* topic) {}
Both "set_topic" method redeclarations are invalid for the same reason.
Diagnosing the first one, foo::set_topic, yields:
tmp.cc:7:11: error: out-of-line definition of 'set_topic' does not match any
declaration in 'foo'
void foo::set_topic(const char* topic) {
^~~~~~~~~
Diagnosing the second one, bar::set_topic, leads to a segfault due to infinite
recursion as DiagnoseInvalidRedeclaration and Sema::ActOnFunctionDeclarator
call each other because the correction returned by Sema::TypoCorrection keeps
flip-flopping between the only two potential corrections, set_types and
add_types, neither of which is correct.
--
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