Commit fbad027d authored by JunHo Seo's avatar JunHo Seo Committed by Commit Bot

Return a value for default (Interface)DowncastTraits::AllowFrom().

Because we don't return any value for it, following warning is printed:
.../wtf/casting.h: In static member function
  '.. bool DowncastTraits<T>::AllowFrom(const U&)':
.../wtf/casting.h:60:3:
  warning: no return statement in function returning non-void [-Wreturn-type]
Used compiler: gcc 8.2.0

To fix the warning, this CL returns false value.

Change-Id: I19d7eef907619c272bdd790770a791aec4a5f03b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362348Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: JunHo Seo <junho0924.seo@lge.com>
Cr-Commit-Position: refs/heads/master@{#801274}
parent 741cd1f3
......@@ -5,6 +5,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_INTERFACE_CASTING_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_INTERFACE_CASTING_H_
#include "base/notreached.h"
namespace blink {
// These are the helpers for downcasting to mixin classes.
......@@ -54,6 +56,8 @@ struct InterfaceDowncastTraits {
template <typename U>
static bool AllowFrom(const U&) {
static_assert(sizeof(U) == 0, "no downcast traits specialization for T");
NOTREACHED();
return false;
}
template <typename U>
static const T& ConvertFrom(const U&) {
......
......@@ -5,6 +5,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_CASTING_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_CASTING_H_
#include "base/notreached.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
namespace blink {
......@@ -57,6 +58,8 @@ struct DowncastTraits {
template <typename U>
static bool AllowFrom(const U&) {
static_assert(sizeof(U) == 0, "no downcast traits specialization for T");
NOTREACHED();
return false;
}
};
......
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