Consistency in namespace-closing comments
[folly.git] / folly / experimental / exception_tracer / ExceptionTracerLib.cpp
index 2ba97b7843f55818e960bfefad39db39611b9106..dcee56921e918d1c17bb173e6db2ab2f7d034be2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,7 +34,6 @@ void __cxa_throw(
     void (*destructor)(void*)) __attribute__((__noreturn__));
 void* __cxa_begin_catch(void* excObj) throw();
 void __cxa_rethrow(void) __attribute__((__noreturn__));
-void __cxa_rethrow(void);
 void __cxa_end_catch(void);
 }
 
@@ -85,8 +84,17 @@ DECLARE_CALLBACK(CxaRethrow);
 DECLARE_CALLBACK(CxaEndCatch);
 DECLARE_CALLBACK(RethrowException);
 
-} // exception_tracer
-} // folly
+} // namespace exception_tracer
+} // namespace folly
+
+// Clang is smart enough to understand that the symbols we're loading
+// are [[noreturn]], but GCC is not. In order to be able to build with
+// -Wunreachable-code enable for Clang, these __builtin_unreachable()
+// calls need to go away. Everything else is messy though, so just
+// #define it to an empty macro under Clang and be done with it.
+#ifdef __clang__
+# define __builtin_unreachable()
+#endif
 
 namespace __cxxabiv1 {