You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A combination of DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN, and DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES doesn't compile on g++ 6.3.0. It compiles fine without DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES.
Steps to reproduce
#include <iostream>
using namespace std;
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#define DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES
#include "doctest.h"
int factorial(int number)
{
return number <= 1 ? number : factorial(number - 1) * number;
}
TEST_CASE("testing the factorial function")
{
CHECK(factorial(1) == 1);
CHECK(factorial(2) == 2);
CHECK(factorial(3) == 6);
CHECK(factorial(10) == 3628800);
}
Compiled using g++ -Wall main.cpp -o main using g++ version 6.3.0 gives the error
main.cpp:15:10: error: expected constructor, destructor, or type conversion before ‘(’ token
TEST_CASE("testing the factorial function")
^
Extra information
doctest version: v1.2.2
Operating System: Debian 9 Stretch
Compiler+version: g++ 6.3.0
The text was updated successfully, but these errors were encountered:
I did not think of that option, but should if course have realized it. I wish the error messages were better.
onqtam
changed the title
Using DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES does not compile using g++ 6.3.0
[support] Using DOCTEST_CONFIG_NO_SHORT_MACRO_NAMES does not compile using g++ 6.3.0
Sep 20, 2017
Description
A combination of
DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
, andDOCTEST_CONFIG_NO_SHORT_MACRO_NAMES
doesn't compile on g++ 6.3.0. It compiles fine withoutDOCTEST_CONFIG_NO_SHORT_MACRO_NAMES
.Steps to reproduce
Compiled using
g++ -Wall main.cpp -o main
using g++ version 6.3.0 gives the errorExtra information
The text was updated successfully, but these errors were encountered: