Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling: error: explicit specialization in non-namespace scope 'class Json' #40

Open
RenHoekNL opened this issue Feb 21, 2023 · 3 comments

Comments

@RenHoekNL
Copy link

RenHoekNL commented Feb 21, 2023

$ c++ -o jtc -Wall -std=gnu++14 -Ofast -static -Wl,--whole-archive -lrt -pthread -lpthread -Wl,--no-whole-archive jtc.cpp
In file included from jtc.cpp:18:
lib/Json.hpp:1971:14: error: explicit specialization in non-namespace scope 'class Json'
1971 | template<>
| ^
lib/Json.hpp:1972:25: error: template-id 'parse_template_Json::Jsn' in declaration of primary template
1972 | bool parse_template_(Jnode &,
| ^~~~~~~~~~~~~~~~~~~~
lib/Json.hpp: In member function 'void Json::parse_array_(Jnode&, Streamstr::const_iterator&)':
lib/Json.hpp:3188:27: warning: macro expands to multiple statements [-Wmultistatement-macros]
3188 | MAY_RETURN_ON_FAILURE( parse_(child, jsp) )
| ^~~~~~
lib/Json.hpp:3051:5: note: in definition of macro 'MAY_RETURN_ON_FAILURE'
3051 | CODE;
| ^~~~
lib/Json.hpp:3187:3: note: some parts of macro expansion are not guarded by this 'if' clause
3187 | if(not parse_template_(child, jsp, TmpPlacement::Value))
| ^~
In file included from jtc.cpp:18:
lib/Json.hpp: In static member function 'static void Json::generate_auto_tokens_(Json::map_jne&, Json::Stringover&, Json::iterator&)':
lib/Json.hpp:5404:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
5404 | if(uct.count(to_upper(t))) DOUT(jit.json()) << dlm << to_upper(t); dlm = ", ";
| ^~
lib/Json.hpp:5404:71: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
5404 | if(uct.count(to_upper(t))) DOUT(jit.json()) << dlm << to_upper(t); dlm = ", ";
| ^~~
lib/Json.hpp:5405:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
5405 | if(lct.count(t)) DOUT(jit.json()) << dlm << t; dlm = ", ";
| ^~
lib/Json.hpp:5405:51: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
5405 | if(lct.count(t)) DOUT(jit.json()) << dlm << t; dlm = ", ";
|

$ uname -a
Linux zabbix 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ c++ --version
c++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0

@ldn-softdev
Copy link
Owner

are you by chance trying to compile the code with line numbers included?

@RenHoekNL
Copy link
Author

RenHoekNL commented Feb 22, 2023

I do this:

git clone https://github.com/ldn-softdev/jtc.git
cd jtc
c++ -o jtc -Wall -std=gnu++14 -Ofast -static -Wl,--whole-archive -lrt -pthread -lpthread -Wl,--no-whole-archive jtc.cpp

@RenHoekNL
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants