Closed mvousden closed 2 years ago
Given source in main.cpp:
main.cpp
#include <macros.h> #include <map> int main() { int rc; std::map<int, int> disaster; disaster[0] = 0; WALKMAP(int, int, disaster, tmp) rc = tmp->second; return rc; }
clang 12.0.1 compiles with warnings (using clang++ -Wall -pedantic -O0 -std=c++98 -I{$GENERICS_DIR} main.cpp)
clang++ -Wall -pedantic -O0 -std=c++98 -I{$GENERICS_DIR} main.cpp
main.cpp:8:5: warning: 'typename' occurs outside of a template [-Wc++11-extensions] WALKMAP(int, int, disaster, tmp) rc = tmp->second; ^ /home/mark/repos/orchestrator/Generics/macros.h:36:13: note: expanded from macro 'WALKMAP' for(TN std::map<KT,DT>::iterator i=v.begin();i!=v.end();i++) ^ /home/mark/repos/orchestrator/Generics/macros.h:12:12: note: expanded from macro 'TN' #define TN typename ^ 1 warning generated.
Given source in
main.cpp
:clang 12.0.1 compiles with warnings (using
clang++ -Wall -pedantic -O0 -std=c++98 -I{$GENERICS_DIR} main.cpp
)