https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71943

            Bug ID: 71943
           Summary: Wreturn-type when combining destructor + return +
                    __noreturn__ function
           Product: gcc
           Version: 6.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sigmaepsilon92 at gmail dot com
  Target Milestone: ---

The following code gives me a Wreturn-type warning:

extern void die(void) __attribute__((__noreturn__));

struct AutoDec{
    ~AutoDec() { }
};

bool testfn(void)
{
    AutoDec ad;
    return false;
    ((0) ? (void)0 : die());
}

I'm not sure how these three lines are related but if I remove any of it(the
struct, the return which causes unreachable code, or the condition around
die()) the warning goes away.

this happens on both ARM and x86/x64, using the following g++ options:
g++ -Wall -c -o /tmp/test.o /tmp/test.cpp

Reply via email to