https://bugs.llvm.org/show_bug.cgi?id=41556

            Bug ID: 41556
           Summary: Bogus warning: all paths through this function will
                    call itself
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: y...@tsoft.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Created attachment 21807
  --> https://bugs.llvm.org/attachment.cgi?id=21807&action=edit
infinite-recursion-testcase.cpp

It prints this bogus warning:
> $ c++ -Wall -o infinite-recursion-testcase infinite-recursion-testcase.cpp
> infinite-recursion-testcase.cpp:9:87: warning: all paths through this 
> function will call itself [-Winfinite-recursion]
>     friend std::ostream& operator<<(std::ostream &os, const AtomSignature 
> &signature) {
>                                                                               
>         ^
> 1 warning generated.


The warning is bogus because it calls itself with a different object. There is
no problem with infinite recursion there.
As long as there is variability in any of the arguments - there is no problem
with infinite recursion.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to