Commit ec66459b authored by Igor Sugak's avatar Igor Sugak Committed by Viswanath Sivakumar

folly: fix mismatched-tags

Summary:
I tried to fix this for default glibc but there are many mismatched-tags inside glibc itself. gcc-4.9-glibc-2.20 does not have such issue, using it.

```lang=bash
% fbconfig --clang --with-project-version clang:dev --extra-cxxflags=-Wmismatched-tags --extra-cxxflags=-ferror-limit=0 --platform-all=gcc-4.9-glibc-2.20-fb -r folly
% fbmake dev -j55 2> err
% perl -n -E 'm/\[-Werror,-Wmismatched-tags\]$/ && print' err | sort -u
./folly/experimental/fibers/TimeoutController.h:52:3: error: 'TimeoutHandle' defined as a struct here but previously declared as a class [-Werror,-Wmismatched-tags]
folly/experimental/fibers/TimeoutController.h:52:3: error: 'TimeoutHandle' defined as a struct here but previously declared as a class [-Werror,-Wmismatched-tags]
folly/experimental/JSONSchema.cpp:65:10: error: class 'ValidationContext' was previously declared as a struct [-Werror,-Wmismatched-tags]
./folly/futures/detail/Core.h:76:1: error: 'Core' defined as a class template here but previously declared as a struct template [-Werror,-Wmismatched-tags]
./folly/futures/Future.h:392:10: error: class 'Promise' was previously declared as a struct [-Werror,-Wmismatched-tags]
./folly/futures/Future.h:45:1: error: 'Future' defined as a class template here but previously declared as a struct template [-Werror,-Wmismatched-tags]
./folly/futures/Future-pre.h:137:1: error: struct 'Timekeeper' was previously declared as a class [-Werror,-Wmismatched-tags]
./folly/futures/Future-pre.h:23:18: error: struct template 'Promise' was previously declared as a class template [-Werror,-Wmismatched-tags]
./folly/futures/Future-pre.h:43:18: error: struct template 'Core' was previously declared as a class template [-Werror,-Wmismatched-tags]
./folly/futures/Promise.h:26:20: error: class template 'Future' was previously declared as a struct template [-Werror,-Wmismatched-tags]
./folly/futures/Timekeeper.h:23:18: error: struct template 'Future' was previously declared as a class template [-Werror,-Wmismatched-tags]
./folly/futures/Timekeeper.h:44:1: error: 'Timekeeper' defined as a class here but previously declared as a struct [-Werror,-Wmismatched-tags]
./folly/Singleton.h:378:10: error: class template 'SingletonHolder' was previously declared as a struct template [-Werror,-Wmismatched-tags]
./folly/wangle/ssl/SSLCacheOptions.h:17:1: error: 'SSLCacheOptions' defined as a struct here but previously declared as a class [-Werror,-Wmismatched-tags]
./folly/wangle/ssl/SSLContextManager.h:29:1: error: class 'SSLCacheOptions' was previously declared as a struct [-Werror,-Wmismatched-tags]
./folly/wangle/ssl/SSLContextManager.h:32:1: error: class 'TLSTicketKeySeeds' was previously declared as a struct [-Werror,-Wmismatched-tags]
% perl -n -E 'm/\[-Werror,-Wmismatched-tags\]$/ && print' err | sort -u | wc -l
16
```

Updated manually. In all cases preferred tag from definition.

Test Plan:
Compile with clang dev and gcc-4.9-glibc-2.20-fb and see fewer errors:
```lang=bash
% fbconfig --clang --with-project-version clang:dev --extra-cxxflags=-Wmismatched-tags --platform-all=gcc-4.9-glibc-2.20-fb -r folly
% fbmake dev -j55
```

Reviewed By: markisaa@fb.com, meyering@fb.com

Subscribers: fugalh, folly-diffs@, jsedgwick, yfeldblum, chalfant

FB internal diff: D2066327

Signature: t1:2066327:1431471232:c65c2827398ba29a4022cc6a5647fac2b3aad717
parent 86d0e6a9
......@@ -375,7 +375,7 @@ class SingletonVault {
private:
template <typename T>
friend class detail::SingletonHolder;
friend struct detail::SingletonHolder;
// The two stages of life for a vault, as mentioned in the class comment.
enum class SingletonVaultState {
......
......@@ -62,7 +62,7 @@ struct IValidator {
virtual ~IValidator() {}
private:
friend class ValidationContext;
friend struct ValidationContext;
virtual Optional<SchemaError> validate(ValidationContext&,
const dynamic& value) const = 0;
......
......@@ -45,7 +45,7 @@ class TimeoutController :
private:
void scheduleRun();
class TimeoutHandle;
struct TimeoutHandle;
typedef std::queue<TimeoutHandle> TimeoutHandleList;
typedef std::unique_ptr<TimeoutHandleList> TimeoutHandleListPtr;
......
......@@ -20,7 +20,7 @@
namespace folly {
template <class> struct Promise;
template <class> class Promise;
template <typename T>
struct isFuture : std::false_type {
......@@ -40,7 +40,7 @@ struct isTry<Try<T>> : std::true_type {};
namespace detail {
template <class> struct Core;
template <class> class Core;
template <class...> struct VariadicContext;
template <class> struct CollectContext;
......@@ -134,6 +134,6 @@ struct Extract<R(Class::*)(Args...)> {
} // detail
struct Timekeeper;
class Timekeeper;
} // namespace
......@@ -20,7 +20,7 @@
namespace folly {
template <class> struct Future;
template <class> class Future;
/// A Timekeeper handles the details of keeping time and fulfilling delay
/// promises. The returned Future<void> will either complete after the
......
......@@ -26,10 +26,10 @@ namespace folly {
class SocketAddress;
class SSLContext;
class ClientHelloExtStats;
class SSLCacheOptions;
struct SSLCacheOptions;
class SSLStats;
class TLSTicketKeyManager;
class TLSTicketKeySeeds;
struct TLSTicketKeySeeds;
class SSLContextManager {
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment