From b459bb4c431670cb3031a68f4b3cf79f631d0c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Mon, 5 Jun 2017 16:59:31 +0200 Subject: [PATCH] Silence GCC's Wunused-function firing in compilation tests The whole GCC kinda sucks around warnings, this is yet another place where pragmas manipulating warnings don't work properly and thus a warning has to be disabled globally... luckily, this time it is happening in selftest file and thus it isn't too problematic to just turn that warning of for the entire file. --- projects/SelfTest/CompilationTests.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/SelfTest/CompilationTests.cpp b/projects/SelfTest/CompilationTests.cpp index 06d361fb..3298c79e 100644 --- a/projects/SelfTest/CompilationTests.cpp +++ b/projects/SelfTest/CompilationTests.cpp @@ -55,6 +55,11 @@ TEST_CASE("#833") { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif +#ifdef __GNUC__ +// Note that because -~GCC~-, this warning cannot be silenced temporarily, by pushing diagnostic stack... +// Luckily it is firing in test files and thus can be silenced for the whole file, without losing much. +#pragma GCC diagnostic ignored "-Wunused-function" +#endif // Test containing example where original stream insertable check breaks compilation namespace {