I have a piece of code that looks like the following. Let\'s say it\'s in a file named example.cpp
#include
#include
You can also check with gdb
$ g++ example.cpp -g
Compile program with -g flag to generate debug info$ gdb a.out
Debug program with gdb(gdb) b main
Put a breakpoint at main(gdb) run
Run program (will pause at breakpoint)(gdb) info source
Prints out something like:
Current source file is example.cpp
Compilation directory is /home/xxx/cpp
Located in /home/xxx/cpp/example.cpp
Contains 7 lines.
Source language is c++.
Producer is GNU C++14 6.3.0 20170516 -mtune=generic -march=x86-64 -g.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
There is the standard used by compiler: Producer is GNU C++14
If you recompile your program using -std=c++11
(for example), gdb detects it:
Producer is GNU C++11