Description of problem: I have replaced the characters I could replace in a working simple C++ project with trigraphs in order to test it. All the trigraphs where accepted and converted for the C++ code, but always for the preprocessor instructions. Version-Release number of selected component (if applicable): g++ (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) Affects both 32 and 64bits releases. How reproducible: On a C++ file that has several preprocessor instructions, sed -i 's/#/??=/g' src/* then compile with --trigraphs argument Actual results: [nux@fedora alter-ego]$ g++ -W -Wall -Wextra -pedantic --trigraphs -g -ggdb -o build/intersection.o -c src/intersection.cpp [...] src/goban.h:5:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <cassert> ^ In file included from src/go.h:7:0, from src/go.cpp:1: src/goban.h:6:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <sstream> ^ In file included from src/go.cpp:1:0: In file included from src/go.h:7:0, from src/go.cpp:1: src/goban.h:6:0: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. make: *** [build/go.o] Error 1 [nux@fedora]$ head src/goban.h ??=ifndef GOBAN_H ??=define GOBAN_H ??=include <cstdarg> ??=include <cassert> ??=include <sstream> ??=include <list> ??=include "config.h" ??=include "intersection.h" Expected results: Only warnings, but no fail, and a successful build. Additional info: Works with clang++
Sorry for the mistake on my second sentance and the omission of the "not". It's clearer like this : All the trigraphs were accepted and converted for the C++ code, but not always for the ??= replacing # in the preprocessor instructions.
Please provide a complete testcase. Compiling your src/goban.h directly doesn't fail for me.
Created attachment 867053 [details] my source code with the # replaced by ??= that makes gcc abort [nux@fedora alter-ego]$ sed -i 's/#/??=/g' src/* [nux@fedora alter-ego]$ make clean rm -rf alter-ego build [nux@fedora alter-ego]$ make mkdir -p build g++ --trigraphs -W -Wall -Wextra -pedantic -g -ggdb -o build/intersection.o -c src/intersection.cpp src/intersection.cpp:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "intersection.h" ^ In file included from src/intersection.cpp:1:0: src/intersection.h:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef INTERSECTION_H ^ src/intersection.h:2:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define INTERSECTION_H ^ src/intersection.h:4:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "config.h" ^ In file included from src/intersection.h:4:0, from src/intersection.cpp:1: src/config.h:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef CONFIG_H ^ src/config.h:2:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define CONFIG_H ^ src/config.h:6:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=endif /* CONFIG_H */ ^ In file included from src/intersection.cpp:1:0: src/intersection.h:5:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "group.h" ^ In file included from src/intersection.h:5:0, from src/intersection.cpp:1: src/group.h:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef GROUP_H ^ src/group.h:2:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define GROUP_H ^ src/group.h:4:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <list> ^ In file included from src/intersection.h:5:0, from src/intersection.cpp:1: src/group.h:5:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <iostream> ^ In file included from src/intersection.h:5:0, from src/intersection.cpp:1: src/group.h:7:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "config.h" ^ src/group.h:29:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=endif /* GROUP_H */ ^ In file included from src/intersection.cpp:1:0: src/intersection.h:26:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=endif /* INTERSECTION_H */ ^ mkdir -p build g++ --trigraphs -W -Wall -Wextra -pedantic -g -ggdb -o build/go.o -c src/go.cpp src/go.cpp:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "go.h" ^ In file included from src/go.cpp:1:0: src/go.h:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef GO_H ^ src/go.h:2:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define GO_H ^ src/go.h:4:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <cassert> ^ In file included from src/go.cpp:1:0: src/go.h:5:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <sstream> ^ In file included from src/go.cpp:1:0: src/go.h:6:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "config.h" ^ In file included from src/go.h:6:0, from src/go.cpp:1: src/config.h:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef CONFIG_H ^ src/config.h:2:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define CONFIG_H ^ src/config.h:6:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=endif /* CONFIG_H */ ^ In file included from src/go.cpp:1:0: src/go.h:7:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "error.h" ^ In file included from src/go.h:7:0, from src/go.cpp:1: src/error.h:1:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef ERROR_H ^ src/error.h:2:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define ERROR_H ^ src/error.h:13:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=endif /* ERROR_H */ ^ In file included from src/go.cpp:1:0: src/go.h:8:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include "goban.h" ^ In file included from src/go.h:8:0, from src/go.cpp:1: src/goban.h:9:2: warning: trigraph ??= converted to # [-Wtrigraphs] ??=ifndef GOBAN_H ^ src/goban.h:10:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=define GOBAN_H ^ src/goban.h:12:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <cstdarg> ^ In file included from src/go.h:8:0, from src/go.cpp:1: src/goban.h:13:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <cassert> ^ In file included from src/go.h:8:0, from src/go.cpp:1: src/goban.h:14:1: warning: trigraph ??= converted to # [-Wtrigraphs] ??=include <sstream> ^ In file included from src/go.cpp:1:0: In file included from src/go.h:8:0, from src/go.cpp:1: src/goban.h:14:0: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. make: *** [build/go.o] Error 1
It's tripping this assert: /* MAP must be an ordinary map and LOC must be non-virtual, encoded into this map, obviously; the accessors used on MAP below ensure it is ordinary. Let's just assert the non-virtualness of LOC here. */ if (linemap_location_from_macro_expansion_p (set, loc)) => abort ();
Tracking this now upstream as http://gcc.gnu.org/PR60400 .