Hi @foonathan ! Thank you very much for this great library!
I was very excited attempting to compile standardese with GCC 12.2 and got stuck on array bounds checking error message on line 123:
https://github.com/foonathan/cppast/blob/7b255252328969435487cd8a06f569b0e4b6847a/src/libclang/libclang_parser.cpp#L118-L129 ,
thus couldn't compile. It's nice to work with such a high level of strictness. It seems to me that the dir string would never be empty, but the compiler is not so convinced, thus I guess we'd need to throw an exception before accessing dir operator[] in case it's empty. Or maybe you got a better idea of how to convince the compiler that string will never be emtpy (caching it in the class constructor, maybe?).
To move forward I just put a check-and-throw before that line and got it to compile till the end. I noticed the code is the same on the main branch.
libclang_parser
Hi @foonathan ! Thank you very much for this great library!
I was very excited attempting to compile
standardese
with GCC 12.2 and got stuck on array bounds checking error message on line 123: https://github.com/foonathan/cppast/blob/7b255252328969435487cd8a06f569b0e4b6847a/src/libclang/libclang_parser.cpp#L118-L129 , thus couldn't compile. It's nice to work with such a high level of strictness. It seems to me that the dir string would never be empty, but the compiler is not so convinced, thus I guess we'd need to throw an exception before accessing dir operator[] in case it's empty. Or maybe you got a better idea of how to convince the compiler that string will never be emtpy (caching it in the class constructor, maybe?).To move forward I just put a check-and-throw before that line and got it to compile till the end. I noticed the code is the same on the main branch.
Input flags:
cmake -S. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="-frecord-gcc-switches" -DLLVM_CONFIG_BINARY=/usr/lib/llvm-15/bin/llvm-config -DCMAKE_CXX_COMPILER=g++
Output: