This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81508] Warning: Control reaches end of non-void function - noreturn attribute ignored if nontrivial destructor runs afterwards


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

--- Comment #5 from Juraj Oršulić <juraj.orsulic at fer dot hr> ---
Thanks on the explanation, Jonathan - you are completely right. I have renamed
the bug title accordingly. Also, here's a further reduction of the working
example - there's no need for a switch and the conditional invocation of
LogMessageFatal.

struct S {
  ~S() { }
};

int flush_result();

class LogMessageFatal {
 public:
  ~LogMessageFatal() __attribute__ ((noreturn));
};


int Flush() {

  S lol;

  if(flush_result()) {
      return 1;
  }

  LogMessageFatal();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]