Commit 6ee9c402 authored by JunHo Seo's avatar JunHo Seo Committed by Commit Bot

GCC: Use GCC pragma instead of clang

1. GCC doesn't support clang pragma. Below is an example:
warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]

Fortunately, clang supports GCC pragma, even though some
warnings are not compatible each other.

2. A warning "-Wdelete-non-abstract-non-virtual-dtor" is a
clang-only flag. It looks like suppression "-Wdelete-non-virtual-dtor"
is better because it is supported by both compiler.

This CL changes to use GCC pragma, and suppress
"-Wdelete-non-virtual-dtor" warning.

Change-Id: I33e42f7465276e60729f9071af96693f57d0f2ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366532
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: default avatarAnton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800072}
parent de949ccc
...@@ -43,10 +43,10 @@ struct FinalizerTraitImpl<T, true> { ...@@ -43,10 +43,10 @@ struct FinalizerTraitImpl<T, true> {
// an object's base class has a virtual destructor. In case there is no virtual // an object's base class has a virtual destructor. In case there is no virtual
// destructor present, the object is always finalized through its leaf type. In // destructor present, the object is always finalized through its leaf type. In
// other words: there is no finalization through a base pointer. // other words: there is no finalization through a base pointer.
#pragma clang diagnostic push #pragma GCC diagnostic push
#pragma clang diagnostic ignored "-Wdelete-non-abstract-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
static_cast<T*>(obj)->~T(); static_cast<T*>(obj)->~T();
#pragma clang diagnostic pop #pragma GCC diagnostic pop
} }
}; };
using FinalizeImpl = using FinalizeImpl =
......
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