[LLVMbugs] [Bug 12019] New: Typo-correcting invalid redecl causes infinite mutual recursion between two methods

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 16 14:03:03 PST 2012


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: unassignedclangbugs at nondot.org
        ReportedBy: rikka at google.com
                CC: llvmbugs at cs.uiuc.edu
    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.



More information about the llvm-bugs mailing list