| 1 | This file contains any messages produced by compilers while |
|---|
| 2 | running configure, to aid debugging if configure makes a mistake. |
|---|
| 3 | |
|---|
| 4 | It was created by graphviz configure 12.2.1, which was |
|---|
| 5 | generated by GNU Autoconf 2.72. Invocation command line was |
|---|
| 6 | |
|---|
| 7 | $ ./configure --prefix=/opt/local ac_cv_prog_AWK=/usr/bin/awk --disable-guile --disable-io --disable-java --disable-lua --disable-man-pdfs --disable-ocaml --disable-perl --disable-php --disable-python --disable-python23 --disable-python24 --disable-python25 --disable-r --disable-ruby --disable-sharp --disable-silent-rules --disable-swig --disable-tcl --with-codegens --with-digcola --with-fontconfig --with-freetype2 --with-gts --with-ipsepcola --with-webp --without-ann --without-devil --without-gdk --without-gdk-pixbuf --without-ghostscript --without-glade --without-glitz --without-gnomeui --without-gtk --without-gtkgl --without-gtkglext --with-lasi --without-ming --with-pangocairo --without-poppler --without-qt --with-quartz --without-rsvg --without-smyrna |
|---|
| 8 | |
|---|
| 9 | ## --------- ## |
|---|
| 10 | ## Platform. ## |
|---|
| 11 | ## --------- ## |
|---|
| 12 | |
|---|
| 13 | hostname = lilMakkie.local |
|---|
| 14 | uname -m = arm64 |
|---|
| 15 | uname -r = 24.3.0 |
|---|
| 16 | uname -s = Darwin |
|---|
| 17 | uname -v = Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 |
|---|
| 18 | |
|---|
| 19 | /usr/bin/uname -p = arm |
|---|
| 20 | /bin/uname -X = unknown |
|---|
| 21 | |
|---|
| 22 | /bin/arch = unknown |
|---|
| 23 | /usr/bin/arch -k = unknown |
|---|
| 24 | /usr/convex/getsysinfo = unknown |
|---|
| 25 | /usr/bin/hostinfo = Mach kernel version: |
|---|
| 26 | Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 |
|---|
| 27 | Kernel configured for up to 12 processors. |
|---|
| 28 | 12 processors are physically available. |
|---|
| 29 | 12 processors are logically available. |
|---|
| 30 | Processor type: arm64e (ARM64E) |
|---|
| 31 | Processors active: 0 1 2 3 4 5 6 7 8 9 10 11 |
|---|
| 32 | Primary memory available: 32.00 gigabytes |
|---|
| 33 | Default processor set: 721 tasks, 4584 threads, 12 processors |
|---|
| 34 | Load average: 3.91, Mach factor: 8.08 |
|---|
| 35 | /bin/machine = unknown |
|---|
| 36 | /usr/bin/oslevel = unknown |
|---|
| 37 | /bin/universe = unknown |
|---|
| 38 | |
|---|
| 39 | PATH: /opt/local/bin/ |
|---|
| 40 | PATH: /opt/local/sbin/ |
|---|
| 41 | PATH: /bin/ |
|---|
| 42 | PATH: /sbin/ |
|---|
| 43 | PATH: /usr/bin/ |
|---|
| 44 | PATH: /usr/sbin/ |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | ## ----------- ## |
|---|
| 48 | ## Core tests. ## |
|---|
| 49 | ## ----------- ## |
|---|
| 50 | |
|---|
| 51 | configure:3504: looking for aux files: ltmain.sh compile missing install-sh config.guess config.sub |
|---|
| 52 | configure:3517: trying ./config/ |
|---|
| 53 | configure:3546: ./config/ltmain.sh found |
|---|
| 54 | configure:3546: ./config/compile found |
|---|
| 55 | configure:3546: ./config/missing found |
|---|
| 56 | configure:3528: ./config/install-sh found |
|---|
| 57 | configure:3546: ./config/config.guess found |
|---|
| 58 | configure:3546: ./config/config.sub found |
|---|
| 59 | configure:3716: checking build system type |
|---|
| 60 | configure:3732: result: aarch64-apple-darwin24.3.0 |
|---|
| 61 | configure:3752: checking host system type |
|---|
| 62 | configure:3767: result: aarch64-apple-darwin24.3.0 |
|---|
| 63 | configure:3930: checking for a BSD-compatible install |
|---|
| 64 | configure:4004: result: /usr/bin/install -c |
|---|
| 65 | configure:4015: checking whether sleep supports fractional seconds |
|---|
| 66 | configure:4031: result: yes |
|---|
| 67 | configure:4034: checking filesystem timestamp resolution |
|---|
| 68 | configure:4169: result: 2 |
|---|
| 69 | configure:4174: checking whether build environment is sane |
|---|
| 70 | configure:4215: result: yes |
|---|
| 71 | configure:4386: checking for a race-free mkdir -p |
|---|
| 72 | configure:4429: result: /opt/local/bin/gmkdir -p |
|---|
| 73 | configure:4436: checking for gawk |
|---|
| 74 | configure:4469: result: /usr/bin/awk |
|---|
| 75 | configure:4480: checking whether make sets $(MAKE) |
|---|
| 76 | configure:4504: result: yes |
|---|
| 77 | configure:4530: checking whether make supports nested variables |
|---|
| 78 | configure:4549: result: yes |
|---|
| 79 | configure:4563: checking xargs -n works |
|---|
| 80 | configure:4579: result: yes |
|---|
| 81 | configure:4659: checking whether UID '502' is supported by ustar format |
|---|
| 82 | configure:4665: result: yes |
|---|
| 83 | configure:4672: checking whether GID '501' is supported by ustar format |
|---|
| 84 | configure:4678: result: yes |
|---|
| 85 | configure:4686: checking how to create a ustar tar archive |
|---|
| 86 | configure:4697: tar --version |
|---|
| 87 | bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8 |
|---|
| 88 | configure:4700: $? = 0 |
|---|
| 89 | configure:4740: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar |
|---|
| 90 | configure:4743: $? = 0 |
|---|
| 91 | configure:4747: tar -xf - <conftest.tar |
|---|
| 92 | configure:4750: $? = 0 |
|---|
| 93 | configure:4752: cat conftest.dir/file |
|---|
| 94 | GrepMe |
|---|
| 95 | configure:4755: $? = 0 |
|---|
| 96 | configure:4770: result: gnutar |
|---|
| 97 | configure:5003: checking whether make supports the include directive |
|---|
| 98 | configure:5018: make -f confmf.GNU && cat confinc.out |
|---|
| 99 | this is the am__doit target |
|---|
| 100 | configure:5021: $? = 0 |
|---|
| 101 | configure:5040: result: yes (GNU style) |
|---|
| 102 | configure:5117: checking for gcc |
|---|
| 103 | configure:5150: result: /usr/bin/clang |
|---|
| 104 | configure:5509: checking for C compiler version |
|---|
| 105 | configure:5518: /usr/bin/clang --version >&5 |
|---|
| 106 | Apple clang version 16.0.0 (clang-1600.0.26.6) |
|---|
| 107 | Target: arm64-apple-darwin24.3.0 |
|---|
| 108 | Thread model: posix |
|---|
| 109 | InstalledDir: /Library/Developer/CommandLineTools/usr/bin |
|---|
| 110 | configure:5529: $? = 0 |
|---|
| 111 | configure:5518: /usr/bin/clang -v >&5 |
|---|
| 112 | Apple clang version 16.0.0 (clang-1600.0.26.6) |
|---|
| 113 | Target: arm64-apple-darwin24.3.0 |
|---|
| 114 | Thread model: posix |
|---|
| 115 | InstalledDir: /Library/Developer/CommandLineTools/usr/bin |
|---|
| 116 | configure:5529: $? = 0 |
|---|
| 117 | configure:5518: /usr/bin/clang -V >&5 |
|---|
| 118 | clang: error: argument to '-V' is missing (expected 1 value) |
|---|
| 119 | clang: error: no input files |
|---|
| 120 | configure:5529: $? = 1 |
|---|
| 121 | configure:5518: /usr/bin/clang -qversion >&5 |
|---|
| 122 | clang: error: unknown argument '-qversion'; did you mean '--version'? |
|---|
| 123 | clang: error: no input files |
|---|
| 124 | configure:5529: $? = 1 |
|---|
| 125 | configure:5518: /usr/bin/clang -version >&5 |
|---|
| 126 | clang: error: unknown argument '-version'; did you mean '--version'? |
|---|
| 127 | clang: error: no input files |
|---|
| 128 | configure:5529: $? = 1 |
|---|
| 129 | configure:5549: checking whether the C compiler works |
|---|
| 130 | configure:5571: /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c >&5 |
|---|
| 131 | configure:5575: $? = 0 |
|---|
| 132 | configure:5626: result: yes |
|---|
| 133 | configure:5630: checking for C compiler default output file name |
|---|
| 134 | configure:5632: result: a.out |
|---|
| 135 | configure:5638: checking for suffix of executables |
|---|
| 136 | configure:5645: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c >&5 |
|---|
| 137 | configure:5649: $? = 0 |
|---|
| 138 | configure:5673: result: |
|---|
| 139 | configure:5697: checking whether we are cross compiling |
|---|
| 140 | configure:5705: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c >&5 |
|---|
| 141 | configure:5709: $? = 0 |
|---|
| 142 | configure:5716: ./conftest |
|---|
| 143 | configure:5720: $? = 0 |
|---|
| 144 | configure:5735: result: no |
|---|
| 145 | configure:5741: checking for suffix of object files |
|---|
| 146 | configure:5764: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 147 | configure:5768: $? = 0 |
|---|
| 148 | configure:5792: result: o |
|---|
| 149 | configure:5796: checking whether the compiler supports GNU C |
|---|
| 150 | configure:5816: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 151 | configure:5816: $? = 0 |
|---|
| 152 | configure:5828: result: yes |
|---|
| 153 | configure:5839: checking whether /usr/bin/clang accepts -g |
|---|
| 154 | configure:5860: /usr/bin/clang -c -g -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 155 | configure:5860: $? = 0 |
|---|
| 156 | configure:5907: result: yes |
|---|
| 157 | configure:5927: checking for /usr/bin/clang option to enable C11 features |
|---|
| 158 | configure:5942: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 159 | configure:5942: $? = 0 |
|---|
| 160 | configure:5961: result: none needed |
|---|
| 161 | configure:6085: checking whether /usr/bin/clang understands -c and -o together |
|---|
| 162 | configure:6108: /usr/bin/clang -c conftest.c -o conftest2.o |
|---|
| 163 | configure:6111: $? = 0 |
|---|
| 164 | configure:6108: /usr/bin/clang -c conftest.c -o conftest2.o |
|---|
| 165 | configure:6111: $? = 0 |
|---|
| 166 | configure:6124: result: yes |
|---|
| 167 | configure:6143: checking dependency style of /usr/bin/clang |
|---|
| 168 | configure:6256: result: gcc3 |
|---|
| 169 | configure:6276: checking for flex |
|---|
| 170 | configure:6297: found /opt/local/bin/flex |
|---|
| 171 | configure:6309: result: flex |
|---|
| 172 | configure:6358: checking for lex output file root |
|---|
| 173 | configure:6371: flex conftest.l |
|---|
| 174 | configure:6375: $? = 0 |
|---|
| 175 | configure:6384: result: lex.yy |
|---|
| 176 | configure:6399: checking for lex library |
|---|
| 177 | configure:6424: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c >&5 |
|---|
| 178 | configure:6424: $? = 0 |
|---|
| 179 | configure:6438: result: none needed |
|---|
| 180 | configure:6454: checking for library containing yywrap |
|---|
| 181 | configure:6490: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c >&5 |
|---|
| 182 | Undefined symbols for architecture arm64: |
|---|
| 183 | "_yywrap", referenced from: |
|---|
| 184 | _main in conftest-1294da.o |
|---|
| 185 | ld: symbol(s) not found for architecture arm64 |
|---|
| 186 | clang: error: linker command failed with exit code 1 (use -v to see invocation) |
|---|
| 187 | configure:6490: $? = 1 |
|---|
| 188 | configure: failed program was: |
|---|
| 189 | | /* confdefs.h */ |
|---|
| 190 | | #define PACKAGE_NAME "graphviz" |
|---|
| 191 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 192 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 193 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 194 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 195 | | #define PACKAGE_URL "" |
|---|
| 196 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 197 | | #define GVPLUGIN_VERSION 6 |
|---|
| 198 | | #define DARWIN 1 |
|---|
| 199 | | #define DARWIN_DYLIB "" |
|---|
| 200 | | #define DEFAULT_DPI 96 |
|---|
| 201 | | #define BROWSER "open" |
|---|
| 202 | | /* end confdefs.h. */ |
|---|
| 203 | | |
|---|
| 204 | | /* Override any GCC internal prototype to avoid an error. |
|---|
| 205 | | Use char because int might match the return type of a GCC |
|---|
| 206 | | builtin and then its argument prototype would still apply. |
|---|
| 207 | | The 'extern "C"' is for builds by C++ compilers; |
|---|
| 208 | | although this is not generally supported in C code supporting it here |
|---|
| 209 | | has little cost and some practical benefit (sr 110532). */ |
|---|
| 210 | | #ifdef __cplusplus |
|---|
| 211 | | extern "C" |
|---|
| 212 | | #endif |
|---|
| 213 | | char yywrap (void); |
|---|
| 214 | | int |
|---|
| 215 | | main (void) |
|---|
| 216 | | { |
|---|
| 217 | | return yywrap (); |
|---|
| 218 | | ; |
|---|
| 219 | | return 0; |
|---|
| 220 | | } |
|---|
| 221 | configure:6490: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c -lfl >&5 |
|---|
| 222 | configure:6490: $? = 0 |
|---|
| 223 | configure:6512: result: -lfl |
|---|
| 224 | configure:6529: checking whether yytext is a pointer |
|---|
| 225 | configure:6545: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 226 | configure:6545: $? = 0 |
|---|
| 227 | configure:6553: result: yes |
|---|
| 228 | configure:6572: checking for bison |
|---|
| 229 | configure:6593: found /opt/local/bin/bison |
|---|
| 230 | configure:6605: result: bison -y |
|---|
| 231 | configure:6617: checking for grep that handles long lines and -e |
|---|
| 232 | configure:6683: result: /usr/bin/grep |
|---|
| 233 | configure:6688: checking for egrep |
|---|
| 234 | configure:6758: result: /usr/bin/grep -E |
|---|
| 235 | configure:6766: checking whether ln -s works |
|---|
| 236 | configure:6770: result: yes |
|---|
| 237 | configure:6824: checking how to print strings |
|---|
| 238 | configure:6851: result: printf |
|---|
| 239 | configure:6872: checking for a sed that does not truncate output |
|---|
| 240 | configure:6944: result: /usr/bin/sed |
|---|
| 241 | configure:6962: checking for fgrep |
|---|
| 242 | configure:7032: result: /usr/bin/grep -F |
|---|
| 243 | configure:7069: checking for ld used by /usr/bin/clang |
|---|
| 244 | configure:7138: result: /Library/Developer/CommandLineTools/usr/bin/ld |
|---|
| 245 | configure:7145: checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld |
|---|
| 246 | configure:7162: result: no |
|---|
| 247 | configure:7174: checking for BSD- or MS-compatible name lister (nm) |
|---|
| 248 | configure:7230: result: /opt/local/bin/nm -B |
|---|
| 249 | configure:7372: checking the name lister (/opt/local/bin/nm -B) interface |
|---|
| 250 | configure:7380: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 251 | configure:7383: /opt/local/bin/nm -B "conftest.o" |
|---|
| 252 | configure:7386: output |
|---|
| 253 | 0000000000000000 S _some_variable |
|---|
| 254 | 0000000000000000 t ltmp0 |
|---|
| 255 | 0000000000000000 s ltmp1 |
|---|
| 256 | configure:7394: result: BSD nm |
|---|
| 257 | configure:7398: checking the maximum length of command line arguments |
|---|
| 258 | configure:7531: result: 786432 |
|---|
| 259 | configure:7579: checking how to convert aarch64-apple-darwin24.3.0 file names to aarch64-apple-darwin24.3.0 format |
|---|
| 260 | configure:7621: result: func_convert_file_noop |
|---|
| 261 | configure:7628: checking how to convert aarch64-apple-darwin24.3.0 file names to toolchain format |
|---|
| 262 | configure:7650: result: func_convert_file_noop |
|---|
| 263 | configure:7657: checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files |
|---|
| 264 | configure:7666: result: -r |
|---|
| 265 | configure:7699: checking for file |
|---|
| 266 | configure:7720: found /usr/bin/file |
|---|
| 267 | configure:7733: result: file |
|---|
| 268 | configure:7796: checking for objdump |
|---|
| 269 | configure:7817: found /opt/local/bin/objdump |
|---|
| 270 | configure:7829: result: objdump |
|---|
| 271 | configure:7861: checking how to recognize dependent libraries |
|---|
| 272 | configure:8070: result: pass_all |
|---|
| 273 | configure:8161: checking for dlltool |
|---|
| 274 | configure:8197: result: no |
|---|
| 275 | configure:8227: checking how to associate runtime and link libraries |
|---|
| 276 | configure:8256: result: printf %s\n |
|---|
| 277 | configure:8316: checking for ranlib |
|---|
| 278 | configure:8337: found /opt/local/bin/ranlib |
|---|
| 279 | configure:8349: result: ranlib |
|---|
| 280 | configure:8426: checking for ar |
|---|
| 281 | configure:8447: found /opt/local/bin/ar |
|---|
| 282 | configure:8459: result: ar |
|---|
| 283 | configure:8512: checking for archiver @FILE support |
|---|
| 284 | configure:8530: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 285 | configure:8530: $? = 0 |
|---|
| 286 | configure:8534: ar cr libconftest.a @conftest.lst >&5 |
|---|
| 287 | ar: @conftest.lst: No such file or directory |
|---|
| 288 | configure:8537: $? = 1 |
|---|
| 289 | configure:8558: result: no |
|---|
| 290 | configure:8622: checking for strip |
|---|
| 291 | configure:8643: found /opt/local/bin/strip |
|---|
| 292 | configure:8655: result: strip |
|---|
| 293 | configure:8758: checking command to parse /opt/local/bin/nm -B output from /usr/bin/clang object |
|---|
| 294 | configure:8912: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 295 | configure:8915: $? = 0 |
|---|
| 296 | configure:8919: /opt/local/bin/nm -B conftest.o | /usr/bin/sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /usr/bin/sed '/ __gnu_lto/d' > conftest.nm |
|---|
| 297 | cannot find nm_test_var in conftest.nm |
|---|
| 298 | configure:8912: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 299 | configure:8915: $? = 0 |
|---|
| 300 | configure:8919: /opt/local/bin/nm -B conftest.o | /usr/bin/sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | /usr/bin/sed '/ __gnu_lto/d' > conftest.nm |
|---|
| 301 | configure:8985: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 conftest.c conftstm.o >&5 |
|---|
| 302 | configure:8988: $? = 0 |
|---|
| 303 | configure:9027: result: ok |
|---|
| 304 | configure:9074: checking for sysroot |
|---|
| 305 | configure:9108: result: no |
|---|
| 306 | configure:9115: checking for a working dd |
|---|
| 307 | configure:9160: result: /bin/dd |
|---|
| 308 | configure:9164: checking how to truncate binary pipes |
|---|
| 309 | configure:9181: result: /bin/dd bs=4096 count=1 |
|---|
| 310 | configure:9521: checking for mt |
|---|
| 311 | configure:9557: result: no |
|---|
| 312 | configure:9577: checking if : is a manifest tool |
|---|
| 313 | configure:9584: : '-?' |
|---|
| 314 | configure:9593: result: no |
|---|
| 315 | configure:9655: checking for dsymutil |
|---|
| 316 | configure:9676: found /usr/bin/dsymutil |
|---|
| 317 | configure:9688: result: dsymutil |
|---|
| 318 | configure:9759: checking for nmedit |
|---|
| 319 | configure:9780: found /usr/bin/nmedit |
|---|
| 320 | configure:9792: result: nmedit |
|---|
| 321 | configure:9863: checking for lipo |
|---|
| 322 | configure:9884: found /opt/local/bin/lipo |
|---|
| 323 | configure:9896: result: lipo |
|---|
| 324 | configure:9967: checking for otool |
|---|
| 325 | configure:9988: found /opt/local/bin/otool |
|---|
| 326 | configure:10000: result: otool |
|---|
| 327 | configure:10071: checking for otool64 |
|---|
| 328 | configure:10107: result: no |
|---|
| 329 | configure:10152: checking for -single_module linker flag |
|---|
| 330 | /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -o libconftest.dylib -dynamiclib -Wl,-single_module conftest.c |
|---|
| 331 | ld: warning: -single_module is obsolete |
|---|
| 332 | configure:10187: result: no |
|---|
| 333 | configure:10192: checking for -no_fixup_chains linker flag |
|---|
| 334 | configure:10211: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -Wl,-no_fixup_chains conftest.c >&5 |
|---|
| 335 | configure:10211: $? = 0 |
|---|
| 336 | configure:10226: result: yes |
|---|
| 337 | configure:10229: checking for -exported_symbols_list linker flag |
|---|
| 338 | configure:10250: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -Wl,-exported_symbols_list,conftest.sym conftest.c >&5 |
|---|
| 339 | configure:10250: $? = 0 |
|---|
| 340 | configure:10263: result: yes |
|---|
| 341 | configure:10266: checking for -force_load linker flag |
|---|
| 342 | /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -c -o conftest.o conftest.c |
|---|
| 343 | ar cr libconftest.a conftest.o |
|---|
| 344 | ranlib libconftest.a |
|---|
| 345 | /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -o conftest conftest.c -Wl,-force_load,./libconftest.a |
|---|
| 346 | configure:10300: result: yes |
|---|
| 347 | configure:10390: checking for stdio.h |
|---|
| 348 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 349 | configure:10390: $? = 0 |
|---|
| 350 | configure:10390: result: yes |
|---|
| 351 | configure:10390: checking for stdlib.h |
|---|
| 352 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 353 | configure:10390: $? = 0 |
|---|
| 354 | configure:10390: result: yes |
|---|
| 355 | configure:10390: checking for string.h |
|---|
| 356 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 357 | configure:10390: $? = 0 |
|---|
| 358 | configure:10390: result: yes |
|---|
| 359 | configure:10390: checking for inttypes.h |
|---|
| 360 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 361 | configure:10390: $? = 0 |
|---|
| 362 | configure:10390: result: yes |
|---|
| 363 | configure:10390: checking for stdint.h |
|---|
| 364 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 365 | configure:10390: $? = 0 |
|---|
| 366 | configure:10390: result: yes |
|---|
| 367 | configure:10390: checking for strings.h |
|---|
| 368 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 369 | configure:10390: $? = 0 |
|---|
| 370 | configure:10390: result: yes |
|---|
| 371 | configure:10390: checking for sys/stat.h |
|---|
| 372 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 373 | configure:10390: $? = 0 |
|---|
| 374 | configure:10390: result: yes |
|---|
| 375 | configure:10390: checking for sys/types.h |
|---|
| 376 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 377 | configure:10390: $? = 0 |
|---|
| 378 | configure:10390: result: yes |
|---|
| 379 | configure:10390: checking for unistd.h |
|---|
| 380 | configure:10390: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 381 | configure:10390: $? = 0 |
|---|
| 382 | configure:10390: result: yes |
|---|
| 383 | configure:10415: checking for dlfcn.h |
|---|
| 384 | configure:10415: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.c >&5 |
|---|
| 385 | configure:10415: $? = 0 |
|---|
| 386 | configure:10415: result: yes |
|---|
| 387 | configure:10654: checking for objdir |
|---|
| 388 | configure:10671: result: .libs |
|---|
| 389 | configure:10937: checking if /usr/bin/clang supports -fno-rtti -fno-exceptions |
|---|
| 390 | configure:10956: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -fno-rtti -fno-exceptions conftest.c >&5 |
|---|
| 391 | configure:10960: $? = 0 |
|---|
| 392 | configure:10974: result: yes |
|---|
| 393 | configure:11347: checking for /usr/bin/clang option to produce PIC |
|---|
| 394 | configure:11356: result: -fno-common -DPIC |
|---|
| 395 | configure:11364: checking if /usr/bin/clang PIC flag -fno-common -DPIC works |
|---|
| 396 | configure:11383: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -fno-common -DPIC -DPIC conftest.c >&5 |
|---|
| 397 | configure:11387: $? = 0 |
|---|
| 398 | configure:11401: result: yes |
|---|
| 399 | configure:11430: checking if /usr/bin/clang static flag -static works |
|---|
| 400 | configure:11460: result: no |
|---|
| 401 | configure:11475: checking if /usr/bin/clang supports -c -o file.o |
|---|
| 402 | configure:11497: /usr/bin/clang -c -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -o out/conftest2.o conftest.c >&5 |
|---|
| 403 | configure:11501: $? = 0 |
|---|
| 404 | configure:11524: result: yes |
|---|
| 405 | configure:11532: checking if /usr/bin/clang supports -c -o file.o |
|---|
| 406 | configure:11581: result: yes |
|---|
| 407 | configure:11614: checking whether the /usr/bin/clang linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries |
|---|
| 408 | configure:12898: result: yes |
|---|
| 409 | configure:13140: checking dynamic linker characteristics |
|---|
| 410 | configure:14524: result: darwin24.3.0 dyld |
|---|
| 411 | configure:14646: checking how to hardcode library paths into programs |
|---|
| 412 | configure:14671: result: immediate |
|---|
| 413 | configure:15271: checking whether stripping libraries is possible |
|---|
| 414 | configure:15288: result: yes |
|---|
| 415 | configure:15322: checking if libtool supports shared libraries |
|---|
| 416 | configure:15324: result: yes |
|---|
| 417 | configure:15327: checking whether to build shared libraries |
|---|
| 418 | configure:15352: result: yes |
|---|
| 419 | configure:15355: checking whether to build static libraries |
|---|
| 420 | configure:15359: result: no |
|---|
| 421 | configure:15630: checking for pkg-config |
|---|
| 422 | configure:15653: found /opt/local/bin/pkg-config |
|---|
| 423 | configure:15666: result: /opt/local/bin/pkg-config |
|---|
| 424 | configure:15691: checking pkg-config is at least version 0.9.0 |
|---|
| 425 | configure:15694: result: yes |
|---|
| 426 | configure:15716: checking for tclsh8.6 |
|---|
| 427 | configure:15755: result: no |
|---|
| 428 | configure:15716: checking for tclsh8.5 |
|---|
| 429 | configure:15739: found /usr/bin/tclsh8.5 |
|---|
| 430 | configure:15752: result: /usr/bin/tclsh8.5 |
|---|
| 431 | configure:15902: checking for C++ compiler version |
|---|
| 432 | configure:15911: /usr/bin/clang++ --version >&5 |
|---|
| 433 | Apple clang version 16.0.0 (clang-1600.0.26.6) |
|---|
| 434 | Target: arm64-apple-darwin24.3.0 |
|---|
| 435 | Thread model: posix |
|---|
| 436 | InstalledDir: /Library/Developer/CommandLineTools/usr/bin |
|---|
| 437 | configure:15922: $? = 0 |
|---|
| 438 | configure:15911: /usr/bin/clang++ -v >&5 |
|---|
| 439 | Apple clang version 16.0.0 (clang-1600.0.26.6) |
|---|
| 440 | Target: arm64-apple-darwin24.3.0 |
|---|
| 441 | Thread model: posix |
|---|
| 442 | InstalledDir: /Library/Developer/CommandLineTools/usr/bin |
|---|
| 443 | configure:15922: $? = 0 |
|---|
| 444 | configure:15911: /usr/bin/clang++ -V >&5 |
|---|
| 445 | clang++: error: argument to '-V' is missing (expected 1 value) |
|---|
| 446 | clang++: error: no input files |
|---|
| 447 | configure:15922: $? = 1 |
|---|
| 448 | configure:15911: /usr/bin/clang++ -qversion >&5 |
|---|
| 449 | clang++: error: unknown argument '-qversion'; did you mean '--version'? |
|---|
| 450 | clang++: error: no input files |
|---|
| 451 | configure:15922: $? = 1 |
|---|
| 452 | configure:15926: checking whether the compiler supports GNU C++ |
|---|
| 453 | configure:15946: /usr/bin/clang++ -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 454 | configure:15946: $? = 0 |
|---|
| 455 | configure:15958: result: yes |
|---|
| 456 | configure:15969: checking whether /usr/bin/clang++ accepts -g |
|---|
| 457 | configure:15990: /usr/bin/clang++ -c -g -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 458 | configure:15990: $? = 0 |
|---|
| 459 | configure:16037: result: yes |
|---|
| 460 | configure:16057: checking for /usr/bin/clang++ option to enable C++11 features |
|---|
| 461 | configure:16072: /usr/bin/clang++ -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 462 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 463 | 36 | #include <cstdlib> |
|---|
| 464 | | ^~~~~~~~~ |
|---|
| 465 | 1 error generated. |
|---|
| 466 | configure:16072: $? = 1 |
|---|
| 467 | configure: failed program was: |
|---|
| 468 | | /* confdefs.h */ |
|---|
| 469 | | #define PACKAGE_NAME "graphviz" |
|---|
| 470 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 471 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 472 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 473 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 474 | | #define PACKAGE_URL "" |
|---|
| 475 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 476 | | #define GVPLUGIN_VERSION 6 |
|---|
| 477 | | #define DARWIN 1 |
|---|
| 478 | | #define DARWIN_DYLIB "" |
|---|
| 479 | | #define DEFAULT_DPI 96 |
|---|
| 480 | | #define BROWSER "open" |
|---|
| 481 | | #define YYTEXT_POINTER 1 |
|---|
| 482 | | #define HAVE_STDIO_H 1 |
|---|
| 483 | | #define HAVE_STDLIB_H 1 |
|---|
| 484 | | #define HAVE_STRING_H 1 |
|---|
| 485 | | #define HAVE_INTTYPES_H 1 |
|---|
| 486 | | #define HAVE_STDINT_H 1 |
|---|
| 487 | | #define HAVE_STRINGS_H 1 |
|---|
| 488 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 489 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 490 | | #define HAVE_UNISTD_H 1 |
|---|
| 491 | | #define STDC_HEADERS 1 |
|---|
| 492 | | #define HAVE_DLFCN_H 1 |
|---|
| 493 | | #define LT_OBJDIR ".libs/" |
|---|
| 494 | | /* end confdefs.h. */ |
|---|
| 495 | | |
|---|
| 496 | | // Does the compiler advertise C++98 conformance? |
|---|
| 497 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 498 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 499 | | #endif |
|---|
| 500 | | |
|---|
| 501 | | // These inclusions are to reject old compilers that |
|---|
| 502 | | // lack the unsuffixed header files. |
|---|
| 503 | | #include <cstdlib> |
|---|
| 504 | | #include <exception> |
|---|
| 505 | | |
|---|
| 506 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 507 | | extern void assert (int); |
|---|
| 508 | | namespace std { |
|---|
| 509 | | extern int strcmp (const char *, const char *); |
|---|
| 510 | | } |
|---|
| 511 | | |
|---|
| 512 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 513 | | using std::exception; |
|---|
| 514 | | using std::strcmp; |
|---|
| 515 | | |
|---|
| 516 | | namespace { |
|---|
| 517 | | |
|---|
| 518 | | void test_exception_syntax() |
|---|
| 519 | | { |
|---|
| 520 | | try { |
|---|
| 521 | | throw "test"; |
|---|
| 522 | | } catch (const char *s) { |
|---|
| 523 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 524 | | // due to lint rules shared with more typical C programs. |
|---|
| 525 | | assert (!(strcmp) (s, "test")); |
|---|
| 526 | | } |
|---|
| 527 | | } |
|---|
| 528 | | |
|---|
| 529 | | template <typename T> struct test_template |
|---|
| 530 | | { |
|---|
| 531 | | T const val; |
|---|
| 532 | | explicit test_template(T t) : val(t) {} |
|---|
| 533 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 534 | | }; |
|---|
| 535 | | |
|---|
| 536 | | } // anonymous namespace |
|---|
| 537 | | |
|---|
| 538 | | |
|---|
| 539 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 540 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 541 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 542 | | #endif |
|---|
| 543 | | |
|---|
| 544 | | namespace cxx11test |
|---|
| 545 | | { |
|---|
| 546 | | constexpr int get_val() { return 20; } |
|---|
| 547 | | |
|---|
| 548 | | struct testinit |
|---|
| 549 | | { |
|---|
| 550 | | int i; |
|---|
| 551 | | double d; |
|---|
| 552 | | }; |
|---|
| 553 | | |
|---|
| 554 | | class delegate |
|---|
| 555 | | { |
|---|
| 556 | | public: |
|---|
| 557 | | delegate(int n) : n(n) {} |
|---|
| 558 | | delegate(): delegate(2354) {} |
|---|
| 559 | | |
|---|
| 560 | | virtual int getval() { return this->n; }; |
|---|
| 561 | | protected: |
|---|
| 562 | | int n; |
|---|
| 563 | | }; |
|---|
| 564 | | |
|---|
| 565 | | class overridden : public delegate |
|---|
| 566 | | { |
|---|
| 567 | | public: |
|---|
| 568 | | overridden(int n): delegate(n) {} |
|---|
| 569 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 570 | | }; |
|---|
| 571 | | |
|---|
| 572 | | class nocopy |
|---|
| 573 | | { |
|---|
| 574 | | public: |
|---|
| 575 | | nocopy(int i): i(i) {} |
|---|
| 576 | | nocopy() = default; |
|---|
| 577 | | nocopy(const nocopy&) = delete; |
|---|
| 578 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 579 | | private: |
|---|
| 580 | | int i; |
|---|
| 581 | | }; |
|---|
| 582 | | |
|---|
| 583 | | // for testing lambda expressions |
|---|
| 584 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 585 | | { |
|---|
| 586 | | return f(v); |
|---|
| 587 | | } |
|---|
| 588 | | |
|---|
| 589 | | // for testing variadic templates and trailing return types |
|---|
| 590 | | template <typename V> auto sum(V first) -> V |
|---|
| 591 | | { |
|---|
| 592 | | return first; |
|---|
| 593 | | } |
|---|
| 594 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 595 | | { |
|---|
| 596 | | return first + sum(rest...); |
|---|
| 597 | | } |
|---|
| 598 | | } |
|---|
| 599 | | |
|---|
| 600 | | |
|---|
| 601 | | int |
|---|
| 602 | | main (int argc, char **argv) |
|---|
| 603 | | { |
|---|
| 604 | | int ok = 0; |
|---|
| 605 | | |
|---|
| 606 | | assert (argc); |
|---|
| 607 | | assert (! argv[0]); |
|---|
| 608 | | { |
|---|
| 609 | | test_exception_syntax (); |
|---|
| 610 | | test_template<double> tt (2.0); |
|---|
| 611 | | assert (tt.add (4) == 6.0); |
|---|
| 612 | | assert (true && !false); |
|---|
| 613 | | } |
|---|
| 614 | | |
|---|
| 615 | | |
|---|
| 616 | | { |
|---|
| 617 | | // Test auto and decltype |
|---|
| 618 | | auto a1 = 6538; |
|---|
| 619 | | auto a2 = 48573953.4; |
|---|
| 620 | | auto a3 = "String literal"; |
|---|
| 621 | | |
|---|
| 622 | | int total = 0; |
|---|
| 623 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 624 | | |
|---|
| 625 | | decltype(a2) a4 = 34895.034; |
|---|
| 626 | | } |
|---|
| 627 | | { |
|---|
| 628 | | // Test constexpr |
|---|
| 629 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 630 | | } |
|---|
| 631 | | { |
|---|
| 632 | | // Test initializer lists |
|---|
| 633 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 634 | | } |
|---|
| 635 | | { |
|---|
| 636 | | // Test range-based for |
|---|
| 637 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 638 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 639 | | for (auto &x : array) { x += 23; } |
|---|
| 640 | | } |
|---|
| 641 | | { |
|---|
| 642 | | // Test lambda expressions |
|---|
| 643 | | using cxx11test::eval; |
|---|
| 644 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 645 | | double d = 2.0; |
|---|
| 646 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 647 | | assert (d == 5.0); |
|---|
| 648 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 649 | | assert (d == 5.0); |
|---|
| 650 | | } |
|---|
| 651 | | { |
|---|
| 652 | | // Test use of variadic templates |
|---|
| 653 | | using cxx11test::sum; |
|---|
| 654 | | auto a = sum(1); |
|---|
| 655 | | auto b = sum(1, 2); |
|---|
| 656 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 657 | | } |
|---|
| 658 | | { |
|---|
| 659 | | // Test constructor delegation |
|---|
| 660 | | cxx11test::delegate d1; |
|---|
| 661 | | cxx11test::delegate d2(); |
|---|
| 662 | | cxx11test::delegate d3(45); |
|---|
| 663 | | } |
|---|
| 664 | | { |
|---|
| 665 | | // Test override and final |
|---|
| 666 | | cxx11test::overridden o1(55464); |
|---|
| 667 | | } |
|---|
| 668 | | { |
|---|
| 669 | | // Test nullptr |
|---|
| 670 | | char *c = nullptr; |
|---|
| 671 | | } |
|---|
| 672 | | { |
|---|
| 673 | | // Test template brackets |
|---|
| 674 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 675 | | } |
|---|
| 676 | | { |
|---|
| 677 | | // Unicode literals |
|---|
| 678 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 679 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 680 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 681 | | } |
|---|
| 682 | | |
|---|
| 683 | | return ok; |
|---|
| 684 | | } |
|---|
| 685 | | |
|---|
| 686 | configure:16072: /usr/bin/clang++ -std=gnu++11 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 687 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 688 | 36 | #include <cstdlib> |
|---|
| 689 | | ^~~~~~~~~ |
|---|
| 690 | 1 error generated. |
|---|
| 691 | configure:16072: $? = 1 |
|---|
| 692 | configure: failed program was: |
|---|
| 693 | | /* confdefs.h */ |
|---|
| 694 | | #define PACKAGE_NAME "graphviz" |
|---|
| 695 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 696 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 697 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 698 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 699 | | #define PACKAGE_URL "" |
|---|
| 700 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 701 | | #define GVPLUGIN_VERSION 6 |
|---|
| 702 | | #define DARWIN 1 |
|---|
| 703 | | #define DARWIN_DYLIB "" |
|---|
| 704 | | #define DEFAULT_DPI 96 |
|---|
| 705 | | #define BROWSER "open" |
|---|
| 706 | | #define YYTEXT_POINTER 1 |
|---|
| 707 | | #define HAVE_STDIO_H 1 |
|---|
| 708 | | #define HAVE_STDLIB_H 1 |
|---|
| 709 | | #define HAVE_STRING_H 1 |
|---|
| 710 | | #define HAVE_INTTYPES_H 1 |
|---|
| 711 | | #define HAVE_STDINT_H 1 |
|---|
| 712 | | #define HAVE_STRINGS_H 1 |
|---|
| 713 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 714 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 715 | | #define HAVE_UNISTD_H 1 |
|---|
| 716 | | #define STDC_HEADERS 1 |
|---|
| 717 | | #define HAVE_DLFCN_H 1 |
|---|
| 718 | | #define LT_OBJDIR ".libs/" |
|---|
| 719 | | /* end confdefs.h. */ |
|---|
| 720 | | |
|---|
| 721 | | // Does the compiler advertise C++98 conformance? |
|---|
| 722 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 723 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 724 | | #endif |
|---|
| 725 | | |
|---|
| 726 | | // These inclusions are to reject old compilers that |
|---|
| 727 | | // lack the unsuffixed header files. |
|---|
| 728 | | #include <cstdlib> |
|---|
| 729 | | #include <exception> |
|---|
| 730 | | |
|---|
| 731 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 732 | | extern void assert (int); |
|---|
| 733 | | namespace std { |
|---|
| 734 | | extern int strcmp (const char *, const char *); |
|---|
| 735 | | } |
|---|
| 736 | | |
|---|
| 737 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 738 | | using std::exception; |
|---|
| 739 | | using std::strcmp; |
|---|
| 740 | | |
|---|
| 741 | | namespace { |
|---|
| 742 | | |
|---|
| 743 | | void test_exception_syntax() |
|---|
| 744 | | { |
|---|
| 745 | | try { |
|---|
| 746 | | throw "test"; |
|---|
| 747 | | } catch (const char *s) { |
|---|
| 748 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 749 | | // due to lint rules shared with more typical C programs. |
|---|
| 750 | | assert (!(strcmp) (s, "test")); |
|---|
| 751 | | } |
|---|
| 752 | | } |
|---|
| 753 | | |
|---|
| 754 | | template <typename T> struct test_template |
|---|
| 755 | | { |
|---|
| 756 | | T const val; |
|---|
| 757 | | explicit test_template(T t) : val(t) {} |
|---|
| 758 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 759 | | }; |
|---|
| 760 | | |
|---|
| 761 | | } // anonymous namespace |
|---|
| 762 | | |
|---|
| 763 | | |
|---|
| 764 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 765 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 766 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 767 | | #endif |
|---|
| 768 | | |
|---|
| 769 | | namespace cxx11test |
|---|
| 770 | | { |
|---|
| 771 | | constexpr int get_val() { return 20; } |
|---|
| 772 | | |
|---|
| 773 | | struct testinit |
|---|
| 774 | | { |
|---|
| 775 | | int i; |
|---|
| 776 | | double d; |
|---|
| 777 | | }; |
|---|
| 778 | | |
|---|
| 779 | | class delegate |
|---|
| 780 | | { |
|---|
| 781 | | public: |
|---|
| 782 | | delegate(int n) : n(n) {} |
|---|
| 783 | | delegate(): delegate(2354) {} |
|---|
| 784 | | |
|---|
| 785 | | virtual int getval() { return this->n; }; |
|---|
| 786 | | protected: |
|---|
| 787 | | int n; |
|---|
| 788 | | }; |
|---|
| 789 | | |
|---|
| 790 | | class overridden : public delegate |
|---|
| 791 | | { |
|---|
| 792 | | public: |
|---|
| 793 | | overridden(int n): delegate(n) {} |
|---|
| 794 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 795 | | }; |
|---|
| 796 | | |
|---|
| 797 | | class nocopy |
|---|
| 798 | | { |
|---|
| 799 | | public: |
|---|
| 800 | | nocopy(int i): i(i) {} |
|---|
| 801 | | nocopy() = default; |
|---|
| 802 | | nocopy(const nocopy&) = delete; |
|---|
| 803 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 804 | | private: |
|---|
| 805 | | int i; |
|---|
| 806 | | }; |
|---|
| 807 | | |
|---|
| 808 | | // for testing lambda expressions |
|---|
| 809 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 810 | | { |
|---|
| 811 | | return f(v); |
|---|
| 812 | | } |
|---|
| 813 | | |
|---|
| 814 | | // for testing variadic templates and trailing return types |
|---|
| 815 | | template <typename V> auto sum(V first) -> V |
|---|
| 816 | | { |
|---|
| 817 | | return first; |
|---|
| 818 | | } |
|---|
| 819 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 820 | | { |
|---|
| 821 | | return first + sum(rest...); |
|---|
| 822 | | } |
|---|
| 823 | | } |
|---|
| 824 | | |
|---|
| 825 | | |
|---|
| 826 | | int |
|---|
| 827 | | main (int argc, char **argv) |
|---|
| 828 | | { |
|---|
| 829 | | int ok = 0; |
|---|
| 830 | | |
|---|
| 831 | | assert (argc); |
|---|
| 832 | | assert (! argv[0]); |
|---|
| 833 | | { |
|---|
| 834 | | test_exception_syntax (); |
|---|
| 835 | | test_template<double> tt (2.0); |
|---|
| 836 | | assert (tt.add (4) == 6.0); |
|---|
| 837 | | assert (true && !false); |
|---|
| 838 | | } |
|---|
| 839 | | |
|---|
| 840 | | |
|---|
| 841 | | { |
|---|
| 842 | | // Test auto and decltype |
|---|
| 843 | | auto a1 = 6538; |
|---|
| 844 | | auto a2 = 48573953.4; |
|---|
| 845 | | auto a3 = "String literal"; |
|---|
| 846 | | |
|---|
| 847 | | int total = 0; |
|---|
| 848 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 849 | | |
|---|
| 850 | | decltype(a2) a4 = 34895.034; |
|---|
| 851 | | } |
|---|
| 852 | | { |
|---|
| 853 | | // Test constexpr |
|---|
| 854 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 855 | | } |
|---|
| 856 | | { |
|---|
| 857 | | // Test initializer lists |
|---|
| 858 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 859 | | } |
|---|
| 860 | | { |
|---|
| 861 | | // Test range-based for |
|---|
| 862 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 863 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 864 | | for (auto &x : array) { x += 23; } |
|---|
| 865 | | } |
|---|
| 866 | | { |
|---|
| 867 | | // Test lambda expressions |
|---|
| 868 | | using cxx11test::eval; |
|---|
| 869 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 870 | | double d = 2.0; |
|---|
| 871 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 872 | | assert (d == 5.0); |
|---|
| 873 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 874 | | assert (d == 5.0); |
|---|
| 875 | | } |
|---|
| 876 | | { |
|---|
| 877 | | // Test use of variadic templates |
|---|
| 878 | | using cxx11test::sum; |
|---|
| 879 | | auto a = sum(1); |
|---|
| 880 | | auto b = sum(1, 2); |
|---|
| 881 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 882 | | } |
|---|
| 883 | | { |
|---|
| 884 | | // Test constructor delegation |
|---|
| 885 | | cxx11test::delegate d1; |
|---|
| 886 | | cxx11test::delegate d2(); |
|---|
| 887 | | cxx11test::delegate d3(45); |
|---|
| 888 | | } |
|---|
| 889 | | { |
|---|
| 890 | | // Test override and final |
|---|
| 891 | | cxx11test::overridden o1(55464); |
|---|
| 892 | | } |
|---|
| 893 | | { |
|---|
| 894 | | // Test nullptr |
|---|
| 895 | | char *c = nullptr; |
|---|
| 896 | | } |
|---|
| 897 | | { |
|---|
| 898 | | // Test template brackets |
|---|
| 899 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 900 | | } |
|---|
| 901 | | { |
|---|
| 902 | | // Unicode literals |
|---|
| 903 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 904 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 905 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 906 | | } |
|---|
| 907 | | |
|---|
| 908 | | return ok; |
|---|
| 909 | | } |
|---|
| 910 | | |
|---|
| 911 | configure:16072: /usr/bin/clang++ -std=gnu++0x -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 912 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 913 | 36 | #include <cstdlib> |
|---|
| 914 | | ^~~~~~~~~ |
|---|
| 915 | 1 error generated. |
|---|
| 916 | configure:16072: $? = 1 |
|---|
| 917 | configure: failed program was: |
|---|
| 918 | | /* confdefs.h */ |
|---|
| 919 | | #define PACKAGE_NAME "graphviz" |
|---|
| 920 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 921 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 922 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 923 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 924 | | #define PACKAGE_URL "" |
|---|
| 925 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 926 | | #define GVPLUGIN_VERSION 6 |
|---|
| 927 | | #define DARWIN 1 |
|---|
| 928 | | #define DARWIN_DYLIB "" |
|---|
| 929 | | #define DEFAULT_DPI 96 |
|---|
| 930 | | #define BROWSER "open" |
|---|
| 931 | | #define YYTEXT_POINTER 1 |
|---|
| 932 | | #define HAVE_STDIO_H 1 |
|---|
| 933 | | #define HAVE_STDLIB_H 1 |
|---|
| 934 | | #define HAVE_STRING_H 1 |
|---|
| 935 | | #define HAVE_INTTYPES_H 1 |
|---|
| 936 | | #define HAVE_STDINT_H 1 |
|---|
| 937 | | #define HAVE_STRINGS_H 1 |
|---|
| 938 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 939 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 940 | | #define HAVE_UNISTD_H 1 |
|---|
| 941 | | #define STDC_HEADERS 1 |
|---|
| 942 | | #define HAVE_DLFCN_H 1 |
|---|
| 943 | | #define LT_OBJDIR ".libs/" |
|---|
| 944 | | /* end confdefs.h. */ |
|---|
| 945 | | |
|---|
| 946 | | // Does the compiler advertise C++98 conformance? |
|---|
| 947 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 948 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 949 | | #endif |
|---|
| 950 | | |
|---|
| 951 | | // These inclusions are to reject old compilers that |
|---|
| 952 | | // lack the unsuffixed header files. |
|---|
| 953 | | #include <cstdlib> |
|---|
| 954 | | #include <exception> |
|---|
| 955 | | |
|---|
| 956 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 957 | | extern void assert (int); |
|---|
| 958 | | namespace std { |
|---|
| 959 | | extern int strcmp (const char *, const char *); |
|---|
| 960 | | } |
|---|
| 961 | | |
|---|
| 962 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 963 | | using std::exception; |
|---|
| 964 | | using std::strcmp; |
|---|
| 965 | | |
|---|
| 966 | | namespace { |
|---|
| 967 | | |
|---|
| 968 | | void test_exception_syntax() |
|---|
| 969 | | { |
|---|
| 970 | | try { |
|---|
| 971 | | throw "test"; |
|---|
| 972 | | } catch (const char *s) { |
|---|
| 973 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 974 | | // due to lint rules shared with more typical C programs. |
|---|
| 975 | | assert (!(strcmp) (s, "test")); |
|---|
| 976 | | } |
|---|
| 977 | | } |
|---|
| 978 | | |
|---|
| 979 | | template <typename T> struct test_template |
|---|
| 980 | | { |
|---|
| 981 | | T const val; |
|---|
| 982 | | explicit test_template(T t) : val(t) {} |
|---|
| 983 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 984 | | }; |
|---|
| 985 | | |
|---|
| 986 | | } // anonymous namespace |
|---|
| 987 | | |
|---|
| 988 | | |
|---|
| 989 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 990 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 991 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 992 | | #endif |
|---|
| 993 | | |
|---|
| 994 | | namespace cxx11test |
|---|
| 995 | | { |
|---|
| 996 | | constexpr int get_val() { return 20; } |
|---|
| 997 | | |
|---|
| 998 | | struct testinit |
|---|
| 999 | | { |
|---|
| 1000 | | int i; |
|---|
| 1001 | | double d; |
|---|
| 1002 | | }; |
|---|
| 1003 | | |
|---|
| 1004 | | class delegate |
|---|
| 1005 | | { |
|---|
| 1006 | | public: |
|---|
| 1007 | | delegate(int n) : n(n) {} |
|---|
| 1008 | | delegate(): delegate(2354) {} |
|---|
| 1009 | | |
|---|
| 1010 | | virtual int getval() { return this->n; }; |
|---|
| 1011 | | protected: |
|---|
| 1012 | | int n; |
|---|
| 1013 | | }; |
|---|
| 1014 | | |
|---|
| 1015 | | class overridden : public delegate |
|---|
| 1016 | | { |
|---|
| 1017 | | public: |
|---|
| 1018 | | overridden(int n): delegate(n) {} |
|---|
| 1019 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 1020 | | }; |
|---|
| 1021 | | |
|---|
| 1022 | | class nocopy |
|---|
| 1023 | | { |
|---|
| 1024 | | public: |
|---|
| 1025 | | nocopy(int i): i(i) {} |
|---|
| 1026 | | nocopy() = default; |
|---|
| 1027 | | nocopy(const nocopy&) = delete; |
|---|
| 1028 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 1029 | | private: |
|---|
| 1030 | | int i; |
|---|
| 1031 | | }; |
|---|
| 1032 | | |
|---|
| 1033 | | // for testing lambda expressions |
|---|
| 1034 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 1035 | | { |
|---|
| 1036 | | return f(v); |
|---|
| 1037 | | } |
|---|
| 1038 | | |
|---|
| 1039 | | // for testing variadic templates and trailing return types |
|---|
| 1040 | | template <typename V> auto sum(V first) -> V |
|---|
| 1041 | | { |
|---|
| 1042 | | return first; |
|---|
| 1043 | | } |
|---|
| 1044 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 1045 | | { |
|---|
| 1046 | | return first + sum(rest...); |
|---|
| 1047 | | } |
|---|
| 1048 | | } |
|---|
| 1049 | | |
|---|
| 1050 | | |
|---|
| 1051 | | int |
|---|
| 1052 | | main (int argc, char **argv) |
|---|
| 1053 | | { |
|---|
| 1054 | | int ok = 0; |
|---|
| 1055 | | |
|---|
| 1056 | | assert (argc); |
|---|
| 1057 | | assert (! argv[0]); |
|---|
| 1058 | | { |
|---|
| 1059 | | test_exception_syntax (); |
|---|
| 1060 | | test_template<double> tt (2.0); |
|---|
| 1061 | | assert (tt.add (4) == 6.0); |
|---|
| 1062 | | assert (true && !false); |
|---|
| 1063 | | } |
|---|
| 1064 | | |
|---|
| 1065 | | |
|---|
| 1066 | | { |
|---|
| 1067 | | // Test auto and decltype |
|---|
| 1068 | | auto a1 = 6538; |
|---|
| 1069 | | auto a2 = 48573953.4; |
|---|
| 1070 | | auto a3 = "String literal"; |
|---|
| 1071 | | |
|---|
| 1072 | | int total = 0; |
|---|
| 1073 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 1074 | | |
|---|
| 1075 | | decltype(a2) a4 = 34895.034; |
|---|
| 1076 | | } |
|---|
| 1077 | | { |
|---|
| 1078 | | // Test constexpr |
|---|
| 1079 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 1080 | | } |
|---|
| 1081 | | { |
|---|
| 1082 | | // Test initializer lists |
|---|
| 1083 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 1084 | | } |
|---|
| 1085 | | { |
|---|
| 1086 | | // Test range-based for |
|---|
| 1087 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 1088 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 1089 | | for (auto &x : array) { x += 23; } |
|---|
| 1090 | | } |
|---|
| 1091 | | { |
|---|
| 1092 | | // Test lambda expressions |
|---|
| 1093 | | using cxx11test::eval; |
|---|
| 1094 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 1095 | | double d = 2.0; |
|---|
| 1096 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 1097 | | assert (d == 5.0); |
|---|
| 1098 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 1099 | | assert (d == 5.0); |
|---|
| 1100 | | } |
|---|
| 1101 | | { |
|---|
| 1102 | | // Test use of variadic templates |
|---|
| 1103 | | using cxx11test::sum; |
|---|
| 1104 | | auto a = sum(1); |
|---|
| 1105 | | auto b = sum(1, 2); |
|---|
| 1106 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 1107 | | } |
|---|
| 1108 | | { |
|---|
| 1109 | | // Test constructor delegation |
|---|
| 1110 | | cxx11test::delegate d1; |
|---|
| 1111 | | cxx11test::delegate d2(); |
|---|
| 1112 | | cxx11test::delegate d3(45); |
|---|
| 1113 | | } |
|---|
| 1114 | | { |
|---|
| 1115 | | // Test override and final |
|---|
| 1116 | | cxx11test::overridden o1(55464); |
|---|
| 1117 | | } |
|---|
| 1118 | | { |
|---|
| 1119 | | // Test nullptr |
|---|
| 1120 | | char *c = nullptr; |
|---|
| 1121 | | } |
|---|
| 1122 | | { |
|---|
| 1123 | | // Test template brackets |
|---|
| 1124 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 1125 | | } |
|---|
| 1126 | | { |
|---|
| 1127 | | // Unicode literals |
|---|
| 1128 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 1129 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 1130 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 1131 | | } |
|---|
| 1132 | | |
|---|
| 1133 | | return ok; |
|---|
| 1134 | | } |
|---|
| 1135 | | |
|---|
| 1136 | configure:16072: /usr/bin/clang++ -std=c++11 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 1137 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 1138 | 36 | #include <cstdlib> |
|---|
| 1139 | | ^~~~~~~~~ |
|---|
| 1140 | 1 error generated. |
|---|
| 1141 | configure:16072: $? = 1 |
|---|
| 1142 | configure: failed program was: |
|---|
| 1143 | | /* confdefs.h */ |
|---|
| 1144 | | #define PACKAGE_NAME "graphviz" |
|---|
| 1145 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 1146 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 1147 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 1148 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 1149 | | #define PACKAGE_URL "" |
|---|
| 1150 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 1151 | | #define GVPLUGIN_VERSION 6 |
|---|
| 1152 | | #define DARWIN 1 |
|---|
| 1153 | | #define DARWIN_DYLIB "" |
|---|
| 1154 | | #define DEFAULT_DPI 96 |
|---|
| 1155 | | #define BROWSER "open" |
|---|
| 1156 | | #define YYTEXT_POINTER 1 |
|---|
| 1157 | | #define HAVE_STDIO_H 1 |
|---|
| 1158 | | #define HAVE_STDLIB_H 1 |
|---|
| 1159 | | #define HAVE_STRING_H 1 |
|---|
| 1160 | | #define HAVE_INTTYPES_H 1 |
|---|
| 1161 | | #define HAVE_STDINT_H 1 |
|---|
| 1162 | | #define HAVE_STRINGS_H 1 |
|---|
| 1163 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 1164 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 1165 | | #define HAVE_UNISTD_H 1 |
|---|
| 1166 | | #define STDC_HEADERS 1 |
|---|
| 1167 | | #define HAVE_DLFCN_H 1 |
|---|
| 1168 | | #define LT_OBJDIR ".libs/" |
|---|
| 1169 | | /* end confdefs.h. */ |
|---|
| 1170 | | |
|---|
| 1171 | | // Does the compiler advertise C++98 conformance? |
|---|
| 1172 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 1173 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 1174 | | #endif |
|---|
| 1175 | | |
|---|
| 1176 | | // These inclusions are to reject old compilers that |
|---|
| 1177 | | // lack the unsuffixed header files. |
|---|
| 1178 | | #include <cstdlib> |
|---|
| 1179 | | #include <exception> |
|---|
| 1180 | | |
|---|
| 1181 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 1182 | | extern void assert (int); |
|---|
| 1183 | | namespace std { |
|---|
| 1184 | | extern int strcmp (const char *, const char *); |
|---|
| 1185 | | } |
|---|
| 1186 | | |
|---|
| 1187 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 1188 | | using std::exception; |
|---|
| 1189 | | using std::strcmp; |
|---|
| 1190 | | |
|---|
| 1191 | | namespace { |
|---|
| 1192 | | |
|---|
| 1193 | | void test_exception_syntax() |
|---|
| 1194 | | { |
|---|
| 1195 | | try { |
|---|
| 1196 | | throw "test"; |
|---|
| 1197 | | } catch (const char *s) { |
|---|
| 1198 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 1199 | | // due to lint rules shared with more typical C programs. |
|---|
| 1200 | | assert (!(strcmp) (s, "test")); |
|---|
| 1201 | | } |
|---|
| 1202 | | } |
|---|
| 1203 | | |
|---|
| 1204 | | template <typename T> struct test_template |
|---|
| 1205 | | { |
|---|
| 1206 | | T const val; |
|---|
| 1207 | | explicit test_template(T t) : val(t) {} |
|---|
| 1208 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 1209 | | }; |
|---|
| 1210 | | |
|---|
| 1211 | | } // anonymous namespace |
|---|
| 1212 | | |
|---|
| 1213 | | |
|---|
| 1214 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 1215 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 1216 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 1217 | | #endif |
|---|
| 1218 | | |
|---|
| 1219 | | namespace cxx11test |
|---|
| 1220 | | { |
|---|
| 1221 | | constexpr int get_val() { return 20; } |
|---|
| 1222 | | |
|---|
| 1223 | | struct testinit |
|---|
| 1224 | | { |
|---|
| 1225 | | int i; |
|---|
| 1226 | | double d; |
|---|
| 1227 | | }; |
|---|
| 1228 | | |
|---|
| 1229 | | class delegate |
|---|
| 1230 | | { |
|---|
| 1231 | | public: |
|---|
| 1232 | | delegate(int n) : n(n) {} |
|---|
| 1233 | | delegate(): delegate(2354) {} |
|---|
| 1234 | | |
|---|
| 1235 | | virtual int getval() { return this->n; }; |
|---|
| 1236 | | protected: |
|---|
| 1237 | | int n; |
|---|
| 1238 | | }; |
|---|
| 1239 | | |
|---|
| 1240 | | class overridden : public delegate |
|---|
| 1241 | | { |
|---|
| 1242 | | public: |
|---|
| 1243 | | overridden(int n): delegate(n) {} |
|---|
| 1244 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 1245 | | }; |
|---|
| 1246 | | |
|---|
| 1247 | | class nocopy |
|---|
| 1248 | | { |
|---|
| 1249 | | public: |
|---|
| 1250 | | nocopy(int i): i(i) {} |
|---|
| 1251 | | nocopy() = default; |
|---|
| 1252 | | nocopy(const nocopy&) = delete; |
|---|
| 1253 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 1254 | | private: |
|---|
| 1255 | | int i; |
|---|
| 1256 | | }; |
|---|
| 1257 | | |
|---|
| 1258 | | // for testing lambda expressions |
|---|
| 1259 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 1260 | | { |
|---|
| 1261 | | return f(v); |
|---|
| 1262 | | } |
|---|
| 1263 | | |
|---|
| 1264 | | // for testing variadic templates and trailing return types |
|---|
| 1265 | | template <typename V> auto sum(V first) -> V |
|---|
| 1266 | | { |
|---|
| 1267 | | return first; |
|---|
| 1268 | | } |
|---|
| 1269 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 1270 | | { |
|---|
| 1271 | | return first + sum(rest...); |
|---|
| 1272 | | } |
|---|
| 1273 | | } |
|---|
| 1274 | | |
|---|
| 1275 | | |
|---|
| 1276 | | int |
|---|
| 1277 | | main (int argc, char **argv) |
|---|
| 1278 | | { |
|---|
| 1279 | | int ok = 0; |
|---|
| 1280 | | |
|---|
| 1281 | | assert (argc); |
|---|
| 1282 | | assert (! argv[0]); |
|---|
| 1283 | | { |
|---|
| 1284 | | test_exception_syntax (); |
|---|
| 1285 | | test_template<double> tt (2.0); |
|---|
| 1286 | | assert (tt.add (4) == 6.0); |
|---|
| 1287 | | assert (true && !false); |
|---|
| 1288 | | } |
|---|
| 1289 | | |
|---|
| 1290 | | |
|---|
| 1291 | | { |
|---|
| 1292 | | // Test auto and decltype |
|---|
| 1293 | | auto a1 = 6538; |
|---|
| 1294 | | auto a2 = 48573953.4; |
|---|
| 1295 | | auto a3 = "String literal"; |
|---|
| 1296 | | |
|---|
| 1297 | | int total = 0; |
|---|
| 1298 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 1299 | | |
|---|
| 1300 | | decltype(a2) a4 = 34895.034; |
|---|
| 1301 | | } |
|---|
| 1302 | | { |
|---|
| 1303 | | // Test constexpr |
|---|
| 1304 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 1305 | | } |
|---|
| 1306 | | { |
|---|
| 1307 | | // Test initializer lists |
|---|
| 1308 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 1309 | | } |
|---|
| 1310 | | { |
|---|
| 1311 | | // Test range-based for |
|---|
| 1312 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 1313 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 1314 | | for (auto &x : array) { x += 23; } |
|---|
| 1315 | | } |
|---|
| 1316 | | { |
|---|
| 1317 | | // Test lambda expressions |
|---|
| 1318 | | using cxx11test::eval; |
|---|
| 1319 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 1320 | | double d = 2.0; |
|---|
| 1321 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 1322 | | assert (d == 5.0); |
|---|
| 1323 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 1324 | | assert (d == 5.0); |
|---|
| 1325 | | } |
|---|
| 1326 | | { |
|---|
| 1327 | | // Test use of variadic templates |
|---|
| 1328 | | using cxx11test::sum; |
|---|
| 1329 | | auto a = sum(1); |
|---|
| 1330 | | auto b = sum(1, 2); |
|---|
| 1331 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 1332 | | } |
|---|
| 1333 | | { |
|---|
| 1334 | | // Test constructor delegation |
|---|
| 1335 | | cxx11test::delegate d1; |
|---|
| 1336 | | cxx11test::delegate d2(); |
|---|
| 1337 | | cxx11test::delegate d3(45); |
|---|
| 1338 | | } |
|---|
| 1339 | | { |
|---|
| 1340 | | // Test override and final |
|---|
| 1341 | | cxx11test::overridden o1(55464); |
|---|
| 1342 | | } |
|---|
| 1343 | | { |
|---|
| 1344 | | // Test nullptr |
|---|
| 1345 | | char *c = nullptr; |
|---|
| 1346 | | } |
|---|
| 1347 | | { |
|---|
| 1348 | | // Test template brackets |
|---|
| 1349 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 1350 | | } |
|---|
| 1351 | | { |
|---|
| 1352 | | // Unicode literals |
|---|
| 1353 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 1354 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 1355 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 1356 | | } |
|---|
| 1357 | | |
|---|
| 1358 | | return ok; |
|---|
| 1359 | | } |
|---|
| 1360 | | |
|---|
| 1361 | configure:16072: /usr/bin/clang++ -std=c++0x -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 1362 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 1363 | 36 | #include <cstdlib> |
|---|
| 1364 | | ^~~~~~~~~ |
|---|
| 1365 | 1 error generated. |
|---|
| 1366 | configure:16072: $? = 1 |
|---|
| 1367 | configure: failed program was: |
|---|
| 1368 | | /* confdefs.h */ |
|---|
| 1369 | | #define PACKAGE_NAME "graphviz" |
|---|
| 1370 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 1371 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 1372 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 1373 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 1374 | | #define PACKAGE_URL "" |
|---|
| 1375 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 1376 | | #define GVPLUGIN_VERSION 6 |
|---|
| 1377 | | #define DARWIN 1 |
|---|
| 1378 | | #define DARWIN_DYLIB "" |
|---|
| 1379 | | #define DEFAULT_DPI 96 |
|---|
| 1380 | | #define BROWSER "open" |
|---|
| 1381 | | #define YYTEXT_POINTER 1 |
|---|
| 1382 | | #define HAVE_STDIO_H 1 |
|---|
| 1383 | | #define HAVE_STDLIB_H 1 |
|---|
| 1384 | | #define HAVE_STRING_H 1 |
|---|
| 1385 | | #define HAVE_INTTYPES_H 1 |
|---|
| 1386 | | #define HAVE_STDINT_H 1 |
|---|
| 1387 | | #define HAVE_STRINGS_H 1 |
|---|
| 1388 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 1389 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 1390 | | #define HAVE_UNISTD_H 1 |
|---|
| 1391 | | #define STDC_HEADERS 1 |
|---|
| 1392 | | #define HAVE_DLFCN_H 1 |
|---|
| 1393 | | #define LT_OBJDIR ".libs/" |
|---|
| 1394 | | /* end confdefs.h. */ |
|---|
| 1395 | | |
|---|
| 1396 | | // Does the compiler advertise C++98 conformance? |
|---|
| 1397 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 1398 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 1399 | | #endif |
|---|
| 1400 | | |
|---|
| 1401 | | // These inclusions are to reject old compilers that |
|---|
| 1402 | | // lack the unsuffixed header files. |
|---|
| 1403 | | #include <cstdlib> |
|---|
| 1404 | | #include <exception> |
|---|
| 1405 | | |
|---|
| 1406 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 1407 | | extern void assert (int); |
|---|
| 1408 | | namespace std { |
|---|
| 1409 | | extern int strcmp (const char *, const char *); |
|---|
| 1410 | | } |
|---|
| 1411 | | |
|---|
| 1412 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 1413 | | using std::exception; |
|---|
| 1414 | | using std::strcmp; |
|---|
| 1415 | | |
|---|
| 1416 | | namespace { |
|---|
| 1417 | | |
|---|
| 1418 | | void test_exception_syntax() |
|---|
| 1419 | | { |
|---|
| 1420 | | try { |
|---|
| 1421 | | throw "test"; |
|---|
| 1422 | | } catch (const char *s) { |
|---|
| 1423 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 1424 | | // due to lint rules shared with more typical C programs. |
|---|
| 1425 | | assert (!(strcmp) (s, "test")); |
|---|
| 1426 | | } |
|---|
| 1427 | | } |
|---|
| 1428 | | |
|---|
| 1429 | | template <typename T> struct test_template |
|---|
| 1430 | | { |
|---|
| 1431 | | T const val; |
|---|
| 1432 | | explicit test_template(T t) : val(t) {} |
|---|
| 1433 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 1434 | | }; |
|---|
| 1435 | | |
|---|
| 1436 | | } // anonymous namespace |
|---|
| 1437 | | |
|---|
| 1438 | | |
|---|
| 1439 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 1440 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 1441 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 1442 | | #endif |
|---|
| 1443 | | |
|---|
| 1444 | | namespace cxx11test |
|---|
| 1445 | | { |
|---|
| 1446 | | constexpr int get_val() { return 20; } |
|---|
| 1447 | | |
|---|
| 1448 | | struct testinit |
|---|
| 1449 | | { |
|---|
| 1450 | | int i; |
|---|
| 1451 | | double d; |
|---|
| 1452 | | }; |
|---|
| 1453 | | |
|---|
| 1454 | | class delegate |
|---|
| 1455 | | { |
|---|
| 1456 | | public: |
|---|
| 1457 | | delegate(int n) : n(n) {} |
|---|
| 1458 | | delegate(): delegate(2354) {} |
|---|
| 1459 | | |
|---|
| 1460 | | virtual int getval() { return this->n; }; |
|---|
| 1461 | | protected: |
|---|
| 1462 | | int n; |
|---|
| 1463 | | }; |
|---|
| 1464 | | |
|---|
| 1465 | | class overridden : public delegate |
|---|
| 1466 | | { |
|---|
| 1467 | | public: |
|---|
| 1468 | | overridden(int n): delegate(n) {} |
|---|
| 1469 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 1470 | | }; |
|---|
| 1471 | | |
|---|
| 1472 | | class nocopy |
|---|
| 1473 | | { |
|---|
| 1474 | | public: |
|---|
| 1475 | | nocopy(int i): i(i) {} |
|---|
| 1476 | | nocopy() = default; |
|---|
| 1477 | | nocopy(const nocopy&) = delete; |
|---|
| 1478 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 1479 | | private: |
|---|
| 1480 | | int i; |
|---|
| 1481 | | }; |
|---|
| 1482 | | |
|---|
| 1483 | | // for testing lambda expressions |
|---|
| 1484 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 1485 | | { |
|---|
| 1486 | | return f(v); |
|---|
| 1487 | | } |
|---|
| 1488 | | |
|---|
| 1489 | | // for testing variadic templates and trailing return types |
|---|
| 1490 | | template <typename V> auto sum(V first) -> V |
|---|
| 1491 | | { |
|---|
| 1492 | | return first; |
|---|
| 1493 | | } |
|---|
| 1494 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 1495 | | { |
|---|
| 1496 | | return first + sum(rest...); |
|---|
| 1497 | | } |
|---|
| 1498 | | } |
|---|
| 1499 | | |
|---|
| 1500 | | |
|---|
| 1501 | | int |
|---|
| 1502 | | main (int argc, char **argv) |
|---|
| 1503 | | { |
|---|
| 1504 | | int ok = 0; |
|---|
| 1505 | | |
|---|
| 1506 | | assert (argc); |
|---|
| 1507 | | assert (! argv[0]); |
|---|
| 1508 | | { |
|---|
| 1509 | | test_exception_syntax (); |
|---|
| 1510 | | test_template<double> tt (2.0); |
|---|
| 1511 | | assert (tt.add (4) == 6.0); |
|---|
| 1512 | | assert (true && !false); |
|---|
| 1513 | | } |
|---|
| 1514 | | |
|---|
| 1515 | | |
|---|
| 1516 | | { |
|---|
| 1517 | | // Test auto and decltype |
|---|
| 1518 | | auto a1 = 6538; |
|---|
| 1519 | | auto a2 = 48573953.4; |
|---|
| 1520 | | auto a3 = "String literal"; |
|---|
| 1521 | | |
|---|
| 1522 | | int total = 0; |
|---|
| 1523 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 1524 | | |
|---|
| 1525 | | decltype(a2) a4 = 34895.034; |
|---|
| 1526 | | } |
|---|
| 1527 | | { |
|---|
| 1528 | | // Test constexpr |
|---|
| 1529 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 1530 | | } |
|---|
| 1531 | | { |
|---|
| 1532 | | // Test initializer lists |
|---|
| 1533 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 1534 | | } |
|---|
| 1535 | | { |
|---|
| 1536 | | // Test range-based for |
|---|
| 1537 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 1538 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 1539 | | for (auto &x : array) { x += 23; } |
|---|
| 1540 | | } |
|---|
| 1541 | | { |
|---|
| 1542 | | // Test lambda expressions |
|---|
| 1543 | | using cxx11test::eval; |
|---|
| 1544 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 1545 | | double d = 2.0; |
|---|
| 1546 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 1547 | | assert (d == 5.0); |
|---|
| 1548 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 1549 | | assert (d == 5.0); |
|---|
| 1550 | | } |
|---|
| 1551 | | { |
|---|
| 1552 | | // Test use of variadic templates |
|---|
| 1553 | | using cxx11test::sum; |
|---|
| 1554 | | auto a = sum(1); |
|---|
| 1555 | | auto b = sum(1, 2); |
|---|
| 1556 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 1557 | | } |
|---|
| 1558 | | { |
|---|
| 1559 | | // Test constructor delegation |
|---|
| 1560 | | cxx11test::delegate d1; |
|---|
| 1561 | | cxx11test::delegate d2(); |
|---|
| 1562 | | cxx11test::delegate d3(45); |
|---|
| 1563 | | } |
|---|
| 1564 | | { |
|---|
| 1565 | | // Test override and final |
|---|
| 1566 | | cxx11test::overridden o1(55464); |
|---|
| 1567 | | } |
|---|
| 1568 | | { |
|---|
| 1569 | | // Test nullptr |
|---|
| 1570 | | char *c = nullptr; |
|---|
| 1571 | | } |
|---|
| 1572 | | { |
|---|
| 1573 | | // Test template brackets |
|---|
| 1574 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 1575 | | } |
|---|
| 1576 | | { |
|---|
| 1577 | | // Unicode literals |
|---|
| 1578 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 1579 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 1580 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 1581 | | } |
|---|
| 1582 | | |
|---|
| 1583 | | return ok; |
|---|
| 1584 | | } |
|---|
| 1585 | | |
|---|
| 1586 | configure:16072: /usr/bin/clang++ -qlanglvl=extended0x -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 1587 | clang++: error: unknown argument: '-qlanglvl=extended0x' |
|---|
| 1588 | configure:16072: $? = 1 |
|---|
| 1589 | configure: failed program was: |
|---|
| 1590 | | /* confdefs.h */ |
|---|
| 1591 | | #define PACKAGE_NAME "graphviz" |
|---|
| 1592 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 1593 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 1594 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 1595 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 1596 | | #define PACKAGE_URL "" |
|---|
| 1597 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 1598 | | #define GVPLUGIN_VERSION 6 |
|---|
| 1599 | | #define DARWIN 1 |
|---|
| 1600 | | #define DARWIN_DYLIB "" |
|---|
| 1601 | | #define DEFAULT_DPI 96 |
|---|
| 1602 | | #define BROWSER "open" |
|---|
| 1603 | | #define YYTEXT_POINTER 1 |
|---|
| 1604 | | #define HAVE_STDIO_H 1 |
|---|
| 1605 | | #define HAVE_STDLIB_H 1 |
|---|
| 1606 | | #define HAVE_STRING_H 1 |
|---|
| 1607 | | #define HAVE_INTTYPES_H 1 |
|---|
| 1608 | | #define HAVE_STDINT_H 1 |
|---|
| 1609 | | #define HAVE_STRINGS_H 1 |
|---|
| 1610 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 1611 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 1612 | | #define HAVE_UNISTD_H 1 |
|---|
| 1613 | | #define STDC_HEADERS 1 |
|---|
| 1614 | | #define HAVE_DLFCN_H 1 |
|---|
| 1615 | | #define LT_OBJDIR ".libs/" |
|---|
| 1616 | | /* end confdefs.h. */ |
|---|
| 1617 | | |
|---|
| 1618 | | // Does the compiler advertise C++98 conformance? |
|---|
| 1619 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 1620 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 1621 | | #endif |
|---|
| 1622 | | |
|---|
| 1623 | | // These inclusions are to reject old compilers that |
|---|
| 1624 | | // lack the unsuffixed header files. |
|---|
| 1625 | | #include <cstdlib> |
|---|
| 1626 | | #include <exception> |
|---|
| 1627 | | |
|---|
| 1628 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 1629 | | extern void assert (int); |
|---|
| 1630 | | namespace std { |
|---|
| 1631 | | extern int strcmp (const char *, const char *); |
|---|
| 1632 | | } |
|---|
| 1633 | | |
|---|
| 1634 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 1635 | | using std::exception; |
|---|
| 1636 | | using std::strcmp; |
|---|
| 1637 | | |
|---|
| 1638 | | namespace { |
|---|
| 1639 | | |
|---|
| 1640 | | void test_exception_syntax() |
|---|
| 1641 | | { |
|---|
| 1642 | | try { |
|---|
| 1643 | | throw "test"; |
|---|
| 1644 | | } catch (const char *s) { |
|---|
| 1645 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 1646 | | // due to lint rules shared with more typical C programs. |
|---|
| 1647 | | assert (!(strcmp) (s, "test")); |
|---|
| 1648 | | } |
|---|
| 1649 | | } |
|---|
| 1650 | | |
|---|
| 1651 | | template <typename T> struct test_template |
|---|
| 1652 | | { |
|---|
| 1653 | | T const val; |
|---|
| 1654 | | explicit test_template(T t) : val(t) {} |
|---|
| 1655 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 1656 | | }; |
|---|
| 1657 | | |
|---|
| 1658 | | } // anonymous namespace |
|---|
| 1659 | | |
|---|
| 1660 | | |
|---|
| 1661 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 1662 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 1663 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 1664 | | #endif |
|---|
| 1665 | | |
|---|
| 1666 | | namespace cxx11test |
|---|
| 1667 | | { |
|---|
| 1668 | | constexpr int get_val() { return 20; } |
|---|
| 1669 | | |
|---|
| 1670 | | struct testinit |
|---|
| 1671 | | { |
|---|
| 1672 | | int i; |
|---|
| 1673 | | double d; |
|---|
| 1674 | | }; |
|---|
| 1675 | | |
|---|
| 1676 | | class delegate |
|---|
| 1677 | | { |
|---|
| 1678 | | public: |
|---|
| 1679 | | delegate(int n) : n(n) {} |
|---|
| 1680 | | delegate(): delegate(2354) {} |
|---|
| 1681 | | |
|---|
| 1682 | | virtual int getval() { return this->n; }; |
|---|
| 1683 | | protected: |
|---|
| 1684 | | int n; |
|---|
| 1685 | | }; |
|---|
| 1686 | | |
|---|
| 1687 | | class overridden : public delegate |
|---|
| 1688 | | { |
|---|
| 1689 | | public: |
|---|
| 1690 | | overridden(int n): delegate(n) {} |
|---|
| 1691 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 1692 | | }; |
|---|
| 1693 | | |
|---|
| 1694 | | class nocopy |
|---|
| 1695 | | { |
|---|
| 1696 | | public: |
|---|
| 1697 | | nocopy(int i): i(i) {} |
|---|
| 1698 | | nocopy() = default; |
|---|
| 1699 | | nocopy(const nocopy&) = delete; |
|---|
| 1700 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 1701 | | private: |
|---|
| 1702 | | int i; |
|---|
| 1703 | | }; |
|---|
| 1704 | | |
|---|
| 1705 | | // for testing lambda expressions |
|---|
| 1706 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 1707 | | { |
|---|
| 1708 | | return f(v); |
|---|
| 1709 | | } |
|---|
| 1710 | | |
|---|
| 1711 | | // for testing variadic templates and trailing return types |
|---|
| 1712 | | template <typename V> auto sum(V first) -> V |
|---|
| 1713 | | { |
|---|
| 1714 | | return first; |
|---|
| 1715 | | } |
|---|
| 1716 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 1717 | | { |
|---|
| 1718 | | return first + sum(rest...); |
|---|
| 1719 | | } |
|---|
| 1720 | | } |
|---|
| 1721 | | |
|---|
| 1722 | | |
|---|
| 1723 | | int |
|---|
| 1724 | | main (int argc, char **argv) |
|---|
| 1725 | | { |
|---|
| 1726 | | int ok = 0; |
|---|
| 1727 | | |
|---|
| 1728 | | assert (argc); |
|---|
| 1729 | | assert (! argv[0]); |
|---|
| 1730 | | { |
|---|
| 1731 | | test_exception_syntax (); |
|---|
| 1732 | | test_template<double> tt (2.0); |
|---|
| 1733 | | assert (tt.add (4) == 6.0); |
|---|
| 1734 | | assert (true && !false); |
|---|
| 1735 | | } |
|---|
| 1736 | | |
|---|
| 1737 | | |
|---|
| 1738 | | { |
|---|
| 1739 | | // Test auto and decltype |
|---|
| 1740 | | auto a1 = 6538; |
|---|
| 1741 | | auto a2 = 48573953.4; |
|---|
| 1742 | | auto a3 = "String literal"; |
|---|
| 1743 | | |
|---|
| 1744 | | int total = 0; |
|---|
| 1745 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 1746 | | |
|---|
| 1747 | | decltype(a2) a4 = 34895.034; |
|---|
| 1748 | | } |
|---|
| 1749 | | { |
|---|
| 1750 | | // Test constexpr |
|---|
| 1751 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 1752 | | } |
|---|
| 1753 | | { |
|---|
| 1754 | | // Test initializer lists |
|---|
| 1755 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 1756 | | } |
|---|
| 1757 | | { |
|---|
| 1758 | | // Test range-based for |
|---|
| 1759 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 1760 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 1761 | | for (auto &x : array) { x += 23; } |
|---|
| 1762 | | } |
|---|
| 1763 | | { |
|---|
| 1764 | | // Test lambda expressions |
|---|
| 1765 | | using cxx11test::eval; |
|---|
| 1766 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 1767 | | double d = 2.0; |
|---|
| 1768 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 1769 | | assert (d == 5.0); |
|---|
| 1770 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 1771 | | assert (d == 5.0); |
|---|
| 1772 | | } |
|---|
| 1773 | | { |
|---|
| 1774 | | // Test use of variadic templates |
|---|
| 1775 | | using cxx11test::sum; |
|---|
| 1776 | | auto a = sum(1); |
|---|
| 1777 | | auto b = sum(1, 2); |
|---|
| 1778 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 1779 | | } |
|---|
| 1780 | | { |
|---|
| 1781 | | // Test constructor delegation |
|---|
| 1782 | | cxx11test::delegate d1; |
|---|
| 1783 | | cxx11test::delegate d2(); |
|---|
| 1784 | | cxx11test::delegate d3(45); |
|---|
| 1785 | | } |
|---|
| 1786 | | { |
|---|
| 1787 | | // Test override and final |
|---|
| 1788 | | cxx11test::overridden o1(55464); |
|---|
| 1789 | | } |
|---|
| 1790 | | { |
|---|
| 1791 | | // Test nullptr |
|---|
| 1792 | | char *c = nullptr; |
|---|
| 1793 | | } |
|---|
| 1794 | | { |
|---|
| 1795 | | // Test template brackets |
|---|
| 1796 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 1797 | | } |
|---|
| 1798 | | { |
|---|
| 1799 | | // Unicode literals |
|---|
| 1800 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 1801 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 1802 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 1803 | | } |
|---|
| 1804 | | |
|---|
| 1805 | | return ok; |
|---|
| 1806 | | } |
|---|
| 1807 | | |
|---|
| 1808 | configure:16072: /usr/bin/clang++ -AA -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 1809 | clang++: warning: argument unused during compilation: '-AA' [-Wunused-command-line-argument] |
|---|
| 1810 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 1811 | 36 | #include <cstdlib> |
|---|
| 1812 | | ^~~~~~~~~ |
|---|
| 1813 | 1 error generated. |
|---|
| 1814 | configure:16072: $? = 1 |
|---|
| 1815 | configure: failed program was: |
|---|
| 1816 | | /* confdefs.h */ |
|---|
| 1817 | | #define PACKAGE_NAME "graphviz" |
|---|
| 1818 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 1819 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 1820 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 1821 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 1822 | | #define PACKAGE_URL "" |
|---|
| 1823 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 1824 | | #define GVPLUGIN_VERSION 6 |
|---|
| 1825 | | #define DARWIN 1 |
|---|
| 1826 | | #define DARWIN_DYLIB "" |
|---|
| 1827 | | #define DEFAULT_DPI 96 |
|---|
| 1828 | | #define BROWSER "open" |
|---|
| 1829 | | #define YYTEXT_POINTER 1 |
|---|
| 1830 | | #define HAVE_STDIO_H 1 |
|---|
| 1831 | | #define HAVE_STDLIB_H 1 |
|---|
| 1832 | | #define HAVE_STRING_H 1 |
|---|
| 1833 | | #define HAVE_INTTYPES_H 1 |
|---|
| 1834 | | #define HAVE_STDINT_H 1 |
|---|
| 1835 | | #define HAVE_STRINGS_H 1 |
|---|
| 1836 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 1837 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 1838 | | #define HAVE_UNISTD_H 1 |
|---|
| 1839 | | #define STDC_HEADERS 1 |
|---|
| 1840 | | #define HAVE_DLFCN_H 1 |
|---|
| 1841 | | #define LT_OBJDIR ".libs/" |
|---|
| 1842 | | /* end confdefs.h. */ |
|---|
| 1843 | | |
|---|
| 1844 | | // Does the compiler advertise C++98 conformance? |
|---|
| 1845 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 1846 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 1847 | | #endif |
|---|
| 1848 | | |
|---|
| 1849 | | // These inclusions are to reject old compilers that |
|---|
| 1850 | | // lack the unsuffixed header files. |
|---|
| 1851 | | #include <cstdlib> |
|---|
| 1852 | | #include <exception> |
|---|
| 1853 | | |
|---|
| 1854 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 1855 | | extern void assert (int); |
|---|
| 1856 | | namespace std { |
|---|
| 1857 | | extern int strcmp (const char *, const char *); |
|---|
| 1858 | | } |
|---|
| 1859 | | |
|---|
| 1860 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 1861 | | using std::exception; |
|---|
| 1862 | | using std::strcmp; |
|---|
| 1863 | | |
|---|
| 1864 | | namespace { |
|---|
| 1865 | | |
|---|
| 1866 | | void test_exception_syntax() |
|---|
| 1867 | | { |
|---|
| 1868 | | try { |
|---|
| 1869 | | throw "test"; |
|---|
| 1870 | | } catch (const char *s) { |
|---|
| 1871 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 1872 | | // due to lint rules shared with more typical C programs. |
|---|
| 1873 | | assert (!(strcmp) (s, "test")); |
|---|
| 1874 | | } |
|---|
| 1875 | | } |
|---|
| 1876 | | |
|---|
| 1877 | | template <typename T> struct test_template |
|---|
| 1878 | | { |
|---|
| 1879 | | T const val; |
|---|
| 1880 | | explicit test_template(T t) : val(t) {} |
|---|
| 1881 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 1882 | | }; |
|---|
| 1883 | | |
|---|
| 1884 | | } // anonymous namespace |
|---|
| 1885 | | |
|---|
| 1886 | | |
|---|
| 1887 | | // Does the compiler advertise C++ 2011 conformance? |
|---|
| 1888 | | #if !defined __cplusplus || __cplusplus < 201103L |
|---|
| 1889 | | # error "Compiler does not advertise C++11 conformance" |
|---|
| 1890 | | #endif |
|---|
| 1891 | | |
|---|
| 1892 | | namespace cxx11test |
|---|
| 1893 | | { |
|---|
| 1894 | | constexpr int get_val() { return 20; } |
|---|
| 1895 | | |
|---|
| 1896 | | struct testinit |
|---|
| 1897 | | { |
|---|
| 1898 | | int i; |
|---|
| 1899 | | double d; |
|---|
| 1900 | | }; |
|---|
| 1901 | | |
|---|
| 1902 | | class delegate |
|---|
| 1903 | | { |
|---|
| 1904 | | public: |
|---|
| 1905 | | delegate(int n) : n(n) {} |
|---|
| 1906 | | delegate(): delegate(2354) {} |
|---|
| 1907 | | |
|---|
| 1908 | | virtual int getval() { return this->n; }; |
|---|
| 1909 | | protected: |
|---|
| 1910 | | int n; |
|---|
| 1911 | | }; |
|---|
| 1912 | | |
|---|
| 1913 | | class overridden : public delegate |
|---|
| 1914 | | { |
|---|
| 1915 | | public: |
|---|
| 1916 | | overridden(int n): delegate(n) {} |
|---|
| 1917 | | virtual int getval() override final { return this->n * 2; } |
|---|
| 1918 | | }; |
|---|
| 1919 | | |
|---|
| 1920 | | class nocopy |
|---|
| 1921 | | { |
|---|
| 1922 | | public: |
|---|
| 1923 | | nocopy(int i): i(i) {} |
|---|
| 1924 | | nocopy() = default; |
|---|
| 1925 | | nocopy(const nocopy&) = delete; |
|---|
| 1926 | | nocopy & operator=(const nocopy&) = delete; |
|---|
| 1927 | | private: |
|---|
| 1928 | | int i; |
|---|
| 1929 | | }; |
|---|
| 1930 | | |
|---|
| 1931 | | // for testing lambda expressions |
|---|
| 1932 | | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) |
|---|
| 1933 | | { |
|---|
| 1934 | | return f(v); |
|---|
| 1935 | | } |
|---|
| 1936 | | |
|---|
| 1937 | | // for testing variadic templates and trailing return types |
|---|
| 1938 | | template <typename V> auto sum(V first) -> V |
|---|
| 1939 | | { |
|---|
| 1940 | | return first; |
|---|
| 1941 | | } |
|---|
| 1942 | | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V |
|---|
| 1943 | | { |
|---|
| 1944 | | return first + sum(rest...); |
|---|
| 1945 | | } |
|---|
| 1946 | | } |
|---|
| 1947 | | |
|---|
| 1948 | | |
|---|
| 1949 | | int |
|---|
| 1950 | | main (int argc, char **argv) |
|---|
| 1951 | | { |
|---|
| 1952 | | int ok = 0; |
|---|
| 1953 | | |
|---|
| 1954 | | assert (argc); |
|---|
| 1955 | | assert (! argv[0]); |
|---|
| 1956 | | { |
|---|
| 1957 | | test_exception_syntax (); |
|---|
| 1958 | | test_template<double> tt (2.0); |
|---|
| 1959 | | assert (tt.add (4) == 6.0); |
|---|
| 1960 | | assert (true && !false); |
|---|
| 1961 | | } |
|---|
| 1962 | | |
|---|
| 1963 | | |
|---|
| 1964 | | { |
|---|
| 1965 | | // Test auto and decltype |
|---|
| 1966 | | auto a1 = 6538; |
|---|
| 1967 | | auto a2 = 48573953.4; |
|---|
| 1968 | | auto a3 = "String literal"; |
|---|
| 1969 | | |
|---|
| 1970 | | int total = 0; |
|---|
| 1971 | | for (auto i = a3; *i; ++i) { total += *i; } |
|---|
| 1972 | | |
|---|
| 1973 | | decltype(a2) a4 = 34895.034; |
|---|
| 1974 | | } |
|---|
| 1975 | | { |
|---|
| 1976 | | // Test constexpr |
|---|
| 1977 | | short sa[cxx11test::get_val()] = { 0 }; |
|---|
| 1978 | | } |
|---|
| 1979 | | { |
|---|
| 1980 | | // Test initializer lists |
|---|
| 1981 | | cxx11test::testinit il = { 4323, 435234.23544 }; |
|---|
| 1982 | | } |
|---|
| 1983 | | { |
|---|
| 1984 | | // Test range-based for |
|---|
| 1985 | | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, |
|---|
| 1986 | | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; |
|---|
| 1987 | | for (auto &x : array) { x += 23; } |
|---|
| 1988 | | } |
|---|
| 1989 | | { |
|---|
| 1990 | | // Test lambda expressions |
|---|
| 1991 | | using cxx11test::eval; |
|---|
| 1992 | | assert (eval ([](int x) { return x*2; }, 21) == 42); |
|---|
| 1993 | | double d = 2.0; |
|---|
| 1994 | | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); |
|---|
| 1995 | | assert (d == 5.0); |
|---|
| 1996 | | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); |
|---|
| 1997 | | assert (d == 5.0); |
|---|
| 1998 | | } |
|---|
| 1999 | | { |
|---|
| 2000 | | // Test use of variadic templates |
|---|
| 2001 | | using cxx11test::sum; |
|---|
| 2002 | | auto a = sum(1); |
|---|
| 2003 | | auto b = sum(1, 2); |
|---|
| 2004 | | auto c = sum(1.0, 2.0, 3.0); |
|---|
| 2005 | | } |
|---|
| 2006 | | { |
|---|
| 2007 | | // Test constructor delegation |
|---|
| 2008 | | cxx11test::delegate d1; |
|---|
| 2009 | | cxx11test::delegate d2(); |
|---|
| 2010 | | cxx11test::delegate d3(45); |
|---|
| 2011 | | } |
|---|
| 2012 | | { |
|---|
| 2013 | | // Test override and final |
|---|
| 2014 | | cxx11test::overridden o1(55464); |
|---|
| 2015 | | } |
|---|
| 2016 | | { |
|---|
| 2017 | | // Test nullptr |
|---|
| 2018 | | char *c = nullptr; |
|---|
| 2019 | | } |
|---|
| 2020 | | { |
|---|
| 2021 | | // Test template brackets |
|---|
| 2022 | | test_template<::test_template<int>> v(test_template<int>(12)); |
|---|
| 2023 | | } |
|---|
| 2024 | | { |
|---|
| 2025 | | // Unicode literals |
|---|
| 2026 | | char const *utf8 = u8"UTF-8 string \u2500"; |
|---|
| 2027 | | char16_t const *utf16 = u"UTF-8 string \u2500"; |
|---|
| 2028 | | char32_t const *utf32 = U"UTF-32 string \u2500"; |
|---|
| 2029 | | } |
|---|
| 2030 | | |
|---|
| 2031 | | return ok; |
|---|
| 2032 | | } |
|---|
| 2033 | | |
|---|
| 2034 | configure:16086: result: unsupported |
|---|
| 2035 | configure:16106: checking for /usr/bin/clang++ option to enable C++98 features |
|---|
| 2036 | configure:16121: /usr/bin/clang++ -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2037 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 2038 | 36 | #include <cstdlib> |
|---|
| 2039 | | ^~~~~~~~~ |
|---|
| 2040 | 1 error generated. |
|---|
| 2041 | configure:16121: $? = 1 |
|---|
| 2042 | configure: failed program was: |
|---|
| 2043 | | /* confdefs.h */ |
|---|
| 2044 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2045 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2046 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2047 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2048 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2049 | | #define PACKAGE_URL "" |
|---|
| 2050 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2051 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2052 | | #define DARWIN 1 |
|---|
| 2053 | | #define DARWIN_DYLIB "" |
|---|
| 2054 | | #define DEFAULT_DPI 96 |
|---|
| 2055 | | #define BROWSER "open" |
|---|
| 2056 | | #define YYTEXT_POINTER 1 |
|---|
| 2057 | | #define HAVE_STDIO_H 1 |
|---|
| 2058 | | #define HAVE_STDLIB_H 1 |
|---|
| 2059 | | #define HAVE_STRING_H 1 |
|---|
| 2060 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2061 | | #define HAVE_STDINT_H 1 |
|---|
| 2062 | | #define HAVE_STRINGS_H 1 |
|---|
| 2063 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2064 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2065 | | #define HAVE_UNISTD_H 1 |
|---|
| 2066 | | #define STDC_HEADERS 1 |
|---|
| 2067 | | #define HAVE_DLFCN_H 1 |
|---|
| 2068 | | #define LT_OBJDIR ".libs/" |
|---|
| 2069 | | /* end confdefs.h. */ |
|---|
| 2070 | | |
|---|
| 2071 | | // Does the compiler advertise C++98 conformance? |
|---|
| 2072 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 2073 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 2074 | | #endif |
|---|
| 2075 | | |
|---|
| 2076 | | // These inclusions are to reject old compilers that |
|---|
| 2077 | | // lack the unsuffixed header files. |
|---|
| 2078 | | #include <cstdlib> |
|---|
| 2079 | | #include <exception> |
|---|
| 2080 | | |
|---|
| 2081 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 2082 | | extern void assert (int); |
|---|
| 2083 | | namespace std { |
|---|
| 2084 | | extern int strcmp (const char *, const char *); |
|---|
| 2085 | | } |
|---|
| 2086 | | |
|---|
| 2087 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 2088 | | using std::exception; |
|---|
| 2089 | | using std::strcmp; |
|---|
| 2090 | | |
|---|
| 2091 | | namespace { |
|---|
| 2092 | | |
|---|
| 2093 | | void test_exception_syntax() |
|---|
| 2094 | | { |
|---|
| 2095 | | try { |
|---|
| 2096 | | throw "test"; |
|---|
| 2097 | | } catch (const char *s) { |
|---|
| 2098 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 2099 | | // due to lint rules shared with more typical C programs. |
|---|
| 2100 | | assert (!(strcmp) (s, "test")); |
|---|
| 2101 | | } |
|---|
| 2102 | | } |
|---|
| 2103 | | |
|---|
| 2104 | | template <typename T> struct test_template |
|---|
| 2105 | | { |
|---|
| 2106 | | T const val; |
|---|
| 2107 | | explicit test_template(T t) : val(t) {} |
|---|
| 2108 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 2109 | | }; |
|---|
| 2110 | | |
|---|
| 2111 | | } // anonymous namespace |
|---|
| 2112 | | |
|---|
| 2113 | | int |
|---|
| 2114 | | main (int argc, char **argv) |
|---|
| 2115 | | { |
|---|
| 2116 | | int ok = 0; |
|---|
| 2117 | | |
|---|
| 2118 | | assert (argc); |
|---|
| 2119 | | assert (! argv[0]); |
|---|
| 2120 | | { |
|---|
| 2121 | | test_exception_syntax (); |
|---|
| 2122 | | test_template<double> tt (2.0); |
|---|
| 2123 | | assert (tt.add (4) == 6.0); |
|---|
| 2124 | | assert (true && !false); |
|---|
| 2125 | | } |
|---|
| 2126 | | |
|---|
| 2127 | | return ok; |
|---|
| 2128 | | } |
|---|
| 2129 | | |
|---|
| 2130 | configure:16121: /usr/bin/clang++ -std=gnu++98 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2131 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 2132 | 36 | #include <cstdlib> |
|---|
| 2133 | | ^~~~~~~~~ |
|---|
| 2134 | 1 error generated. |
|---|
| 2135 | configure:16121: $? = 1 |
|---|
| 2136 | configure: failed program was: |
|---|
| 2137 | | /* confdefs.h */ |
|---|
| 2138 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2139 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2140 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2141 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2142 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2143 | | #define PACKAGE_URL "" |
|---|
| 2144 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2145 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2146 | | #define DARWIN 1 |
|---|
| 2147 | | #define DARWIN_DYLIB "" |
|---|
| 2148 | | #define DEFAULT_DPI 96 |
|---|
| 2149 | | #define BROWSER "open" |
|---|
| 2150 | | #define YYTEXT_POINTER 1 |
|---|
| 2151 | | #define HAVE_STDIO_H 1 |
|---|
| 2152 | | #define HAVE_STDLIB_H 1 |
|---|
| 2153 | | #define HAVE_STRING_H 1 |
|---|
| 2154 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2155 | | #define HAVE_STDINT_H 1 |
|---|
| 2156 | | #define HAVE_STRINGS_H 1 |
|---|
| 2157 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2158 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2159 | | #define HAVE_UNISTD_H 1 |
|---|
| 2160 | | #define STDC_HEADERS 1 |
|---|
| 2161 | | #define HAVE_DLFCN_H 1 |
|---|
| 2162 | | #define LT_OBJDIR ".libs/" |
|---|
| 2163 | | /* end confdefs.h. */ |
|---|
| 2164 | | |
|---|
| 2165 | | // Does the compiler advertise C++98 conformance? |
|---|
| 2166 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 2167 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 2168 | | #endif |
|---|
| 2169 | | |
|---|
| 2170 | | // These inclusions are to reject old compilers that |
|---|
| 2171 | | // lack the unsuffixed header files. |
|---|
| 2172 | | #include <cstdlib> |
|---|
| 2173 | | #include <exception> |
|---|
| 2174 | | |
|---|
| 2175 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 2176 | | extern void assert (int); |
|---|
| 2177 | | namespace std { |
|---|
| 2178 | | extern int strcmp (const char *, const char *); |
|---|
| 2179 | | } |
|---|
| 2180 | | |
|---|
| 2181 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 2182 | | using std::exception; |
|---|
| 2183 | | using std::strcmp; |
|---|
| 2184 | | |
|---|
| 2185 | | namespace { |
|---|
| 2186 | | |
|---|
| 2187 | | void test_exception_syntax() |
|---|
| 2188 | | { |
|---|
| 2189 | | try { |
|---|
| 2190 | | throw "test"; |
|---|
| 2191 | | } catch (const char *s) { |
|---|
| 2192 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 2193 | | // due to lint rules shared with more typical C programs. |
|---|
| 2194 | | assert (!(strcmp) (s, "test")); |
|---|
| 2195 | | } |
|---|
| 2196 | | } |
|---|
| 2197 | | |
|---|
| 2198 | | template <typename T> struct test_template |
|---|
| 2199 | | { |
|---|
| 2200 | | T const val; |
|---|
| 2201 | | explicit test_template(T t) : val(t) {} |
|---|
| 2202 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 2203 | | }; |
|---|
| 2204 | | |
|---|
| 2205 | | } // anonymous namespace |
|---|
| 2206 | | |
|---|
| 2207 | | int |
|---|
| 2208 | | main (int argc, char **argv) |
|---|
| 2209 | | { |
|---|
| 2210 | | int ok = 0; |
|---|
| 2211 | | |
|---|
| 2212 | | assert (argc); |
|---|
| 2213 | | assert (! argv[0]); |
|---|
| 2214 | | { |
|---|
| 2215 | | test_exception_syntax (); |
|---|
| 2216 | | test_template<double> tt (2.0); |
|---|
| 2217 | | assert (tt.add (4) == 6.0); |
|---|
| 2218 | | assert (true && !false); |
|---|
| 2219 | | } |
|---|
| 2220 | | |
|---|
| 2221 | | return ok; |
|---|
| 2222 | | } |
|---|
| 2223 | | |
|---|
| 2224 | configure:16121: /usr/bin/clang++ -std=c++98 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2225 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 2226 | 36 | #include <cstdlib> |
|---|
| 2227 | | ^~~~~~~~~ |
|---|
| 2228 | 1 error generated. |
|---|
| 2229 | configure:16121: $? = 1 |
|---|
| 2230 | configure: failed program was: |
|---|
| 2231 | | /* confdefs.h */ |
|---|
| 2232 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2233 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2234 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2235 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2236 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2237 | | #define PACKAGE_URL "" |
|---|
| 2238 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2239 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2240 | | #define DARWIN 1 |
|---|
| 2241 | | #define DARWIN_DYLIB "" |
|---|
| 2242 | | #define DEFAULT_DPI 96 |
|---|
| 2243 | | #define BROWSER "open" |
|---|
| 2244 | | #define YYTEXT_POINTER 1 |
|---|
| 2245 | | #define HAVE_STDIO_H 1 |
|---|
| 2246 | | #define HAVE_STDLIB_H 1 |
|---|
| 2247 | | #define HAVE_STRING_H 1 |
|---|
| 2248 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2249 | | #define HAVE_STDINT_H 1 |
|---|
| 2250 | | #define HAVE_STRINGS_H 1 |
|---|
| 2251 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2252 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2253 | | #define HAVE_UNISTD_H 1 |
|---|
| 2254 | | #define STDC_HEADERS 1 |
|---|
| 2255 | | #define HAVE_DLFCN_H 1 |
|---|
| 2256 | | #define LT_OBJDIR ".libs/" |
|---|
| 2257 | | /* end confdefs.h. */ |
|---|
| 2258 | | |
|---|
| 2259 | | // Does the compiler advertise C++98 conformance? |
|---|
| 2260 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 2261 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 2262 | | #endif |
|---|
| 2263 | | |
|---|
| 2264 | | // These inclusions are to reject old compilers that |
|---|
| 2265 | | // lack the unsuffixed header files. |
|---|
| 2266 | | #include <cstdlib> |
|---|
| 2267 | | #include <exception> |
|---|
| 2268 | | |
|---|
| 2269 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 2270 | | extern void assert (int); |
|---|
| 2271 | | namespace std { |
|---|
| 2272 | | extern int strcmp (const char *, const char *); |
|---|
| 2273 | | } |
|---|
| 2274 | | |
|---|
| 2275 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 2276 | | using std::exception; |
|---|
| 2277 | | using std::strcmp; |
|---|
| 2278 | | |
|---|
| 2279 | | namespace { |
|---|
| 2280 | | |
|---|
| 2281 | | void test_exception_syntax() |
|---|
| 2282 | | { |
|---|
| 2283 | | try { |
|---|
| 2284 | | throw "test"; |
|---|
| 2285 | | } catch (const char *s) { |
|---|
| 2286 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 2287 | | // due to lint rules shared with more typical C programs. |
|---|
| 2288 | | assert (!(strcmp) (s, "test")); |
|---|
| 2289 | | } |
|---|
| 2290 | | } |
|---|
| 2291 | | |
|---|
| 2292 | | template <typename T> struct test_template |
|---|
| 2293 | | { |
|---|
| 2294 | | T const val; |
|---|
| 2295 | | explicit test_template(T t) : val(t) {} |
|---|
| 2296 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 2297 | | }; |
|---|
| 2298 | | |
|---|
| 2299 | | } // anonymous namespace |
|---|
| 2300 | | |
|---|
| 2301 | | int |
|---|
| 2302 | | main (int argc, char **argv) |
|---|
| 2303 | | { |
|---|
| 2304 | | int ok = 0; |
|---|
| 2305 | | |
|---|
| 2306 | | assert (argc); |
|---|
| 2307 | | assert (! argv[0]); |
|---|
| 2308 | | { |
|---|
| 2309 | | test_exception_syntax (); |
|---|
| 2310 | | test_template<double> tt (2.0); |
|---|
| 2311 | | assert (tt.add (4) == 6.0); |
|---|
| 2312 | | assert (true && !false); |
|---|
| 2313 | | } |
|---|
| 2314 | | |
|---|
| 2315 | | return ok; |
|---|
| 2316 | | } |
|---|
| 2317 | | |
|---|
| 2318 | configure:16121: /usr/bin/clang++ -qlanglvl=extended -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2319 | clang++: error: unknown argument: '-qlanglvl=extended' |
|---|
| 2320 | configure:16121: $? = 1 |
|---|
| 2321 | configure: failed program was: |
|---|
| 2322 | | /* confdefs.h */ |
|---|
| 2323 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2324 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2325 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2326 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2327 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2328 | | #define PACKAGE_URL "" |
|---|
| 2329 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2330 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2331 | | #define DARWIN 1 |
|---|
| 2332 | | #define DARWIN_DYLIB "" |
|---|
| 2333 | | #define DEFAULT_DPI 96 |
|---|
| 2334 | | #define BROWSER "open" |
|---|
| 2335 | | #define YYTEXT_POINTER 1 |
|---|
| 2336 | | #define HAVE_STDIO_H 1 |
|---|
| 2337 | | #define HAVE_STDLIB_H 1 |
|---|
| 2338 | | #define HAVE_STRING_H 1 |
|---|
| 2339 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2340 | | #define HAVE_STDINT_H 1 |
|---|
| 2341 | | #define HAVE_STRINGS_H 1 |
|---|
| 2342 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2343 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2344 | | #define HAVE_UNISTD_H 1 |
|---|
| 2345 | | #define STDC_HEADERS 1 |
|---|
| 2346 | | #define HAVE_DLFCN_H 1 |
|---|
| 2347 | | #define LT_OBJDIR ".libs/" |
|---|
| 2348 | | /* end confdefs.h. */ |
|---|
| 2349 | | |
|---|
| 2350 | | // Does the compiler advertise C++98 conformance? |
|---|
| 2351 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 2352 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 2353 | | #endif |
|---|
| 2354 | | |
|---|
| 2355 | | // These inclusions are to reject old compilers that |
|---|
| 2356 | | // lack the unsuffixed header files. |
|---|
| 2357 | | #include <cstdlib> |
|---|
| 2358 | | #include <exception> |
|---|
| 2359 | | |
|---|
| 2360 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 2361 | | extern void assert (int); |
|---|
| 2362 | | namespace std { |
|---|
| 2363 | | extern int strcmp (const char *, const char *); |
|---|
| 2364 | | } |
|---|
| 2365 | | |
|---|
| 2366 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 2367 | | using std::exception; |
|---|
| 2368 | | using std::strcmp; |
|---|
| 2369 | | |
|---|
| 2370 | | namespace { |
|---|
| 2371 | | |
|---|
| 2372 | | void test_exception_syntax() |
|---|
| 2373 | | { |
|---|
| 2374 | | try { |
|---|
| 2375 | | throw "test"; |
|---|
| 2376 | | } catch (const char *s) { |
|---|
| 2377 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 2378 | | // due to lint rules shared with more typical C programs. |
|---|
| 2379 | | assert (!(strcmp) (s, "test")); |
|---|
| 2380 | | } |
|---|
| 2381 | | } |
|---|
| 2382 | | |
|---|
| 2383 | | template <typename T> struct test_template |
|---|
| 2384 | | { |
|---|
| 2385 | | T const val; |
|---|
| 2386 | | explicit test_template(T t) : val(t) {} |
|---|
| 2387 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 2388 | | }; |
|---|
| 2389 | | |
|---|
| 2390 | | } // anonymous namespace |
|---|
| 2391 | | |
|---|
| 2392 | | int |
|---|
| 2393 | | main (int argc, char **argv) |
|---|
| 2394 | | { |
|---|
| 2395 | | int ok = 0; |
|---|
| 2396 | | |
|---|
| 2397 | | assert (argc); |
|---|
| 2398 | | assert (! argv[0]); |
|---|
| 2399 | | { |
|---|
| 2400 | | test_exception_syntax (); |
|---|
| 2401 | | test_template<double> tt (2.0); |
|---|
| 2402 | | assert (tt.add (4) == 6.0); |
|---|
| 2403 | | assert (true && !false); |
|---|
| 2404 | | } |
|---|
| 2405 | | |
|---|
| 2406 | | return ok; |
|---|
| 2407 | | } |
|---|
| 2408 | | |
|---|
| 2409 | configure:16121: /usr/bin/clang++ -AA -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2410 | clang++: warning: argument unused during compilation: '-AA' [-Wunused-command-line-argument] |
|---|
| 2411 | conftest.cpp:36:10: fatal error: 'cstdlib' file not found |
|---|
| 2412 | 36 | #include <cstdlib> |
|---|
| 2413 | | ^~~~~~~~~ |
|---|
| 2414 | 1 error generated. |
|---|
| 2415 | configure:16121: $? = 1 |
|---|
| 2416 | configure: failed program was: |
|---|
| 2417 | | /* confdefs.h */ |
|---|
| 2418 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2419 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2420 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2421 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2422 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2423 | | #define PACKAGE_URL "" |
|---|
| 2424 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2425 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2426 | | #define DARWIN 1 |
|---|
| 2427 | | #define DARWIN_DYLIB "" |
|---|
| 2428 | | #define DEFAULT_DPI 96 |
|---|
| 2429 | | #define BROWSER "open" |
|---|
| 2430 | | #define YYTEXT_POINTER 1 |
|---|
| 2431 | | #define HAVE_STDIO_H 1 |
|---|
| 2432 | | #define HAVE_STDLIB_H 1 |
|---|
| 2433 | | #define HAVE_STRING_H 1 |
|---|
| 2434 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2435 | | #define HAVE_STDINT_H 1 |
|---|
| 2436 | | #define HAVE_STRINGS_H 1 |
|---|
| 2437 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2438 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2439 | | #define HAVE_UNISTD_H 1 |
|---|
| 2440 | | #define STDC_HEADERS 1 |
|---|
| 2441 | | #define HAVE_DLFCN_H 1 |
|---|
| 2442 | | #define LT_OBJDIR ".libs/" |
|---|
| 2443 | | /* end confdefs.h. */ |
|---|
| 2444 | | |
|---|
| 2445 | | // Does the compiler advertise C++98 conformance? |
|---|
| 2446 | | #if !defined __cplusplus || __cplusplus < 199711L |
|---|
| 2447 | | # error "Compiler does not advertise C++98 conformance" |
|---|
| 2448 | | #endif |
|---|
| 2449 | | |
|---|
| 2450 | | // These inclusions are to reject old compilers that |
|---|
| 2451 | | // lack the unsuffixed header files. |
|---|
| 2452 | | #include <cstdlib> |
|---|
| 2453 | | #include <exception> |
|---|
| 2454 | | |
|---|
| 2455 | | // <cassert> and <cstring> are *not* freestanding headers in C++98. |
|---|
| 2456 | | extern void assert (int); |
|---|
| 2457 | | namespace std { |
|---|
| 2458 | | extern int strcmp (const char *, const char *); |
|---|
| 2459 | | } |
|---|
| 2460 | | |
|---|
| 2461 | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". |
|---|
| 2462 | | using std::exception; |
|---|
| 2463 | | using std::strcmp; |
|---|
| 2464 | | |
|---|
| 2465 | | namespace { |
|---|
| 2466 | | |
|---|
| 2467 | | void test_exception_syntax() |
|---|
| 2468 | | { |
|---|
| 2469 | | try { |
|---|
| 2470 | | throw "test"; |
|---|
| 2471 | | } catch (const char *s) { |
|---|
| 2472 | | // Extra parentheses suppress a warning when building autoconf itself, |
|---|
| 2473 | | // due to lint rules shared with more typical C programs. |
|---|
| 2474 | | assert (!(strcmp) (s, "test")); |
|---|
| 2475 | | } |
|---|
| 2476 | | } |
|---|
| 2477 | | |
|---|
| 2478 | | template <typename T> struct test_template |
|---|
| 2479 | | { |
|---|
| 2480 | | T const val; |
|---|
| 2481 | | explicit test_template(T t) : val(t) {} |
|---|
| 2482 | | template <typename U> T add(U u) { return static_cast<T>(u) + val; } |
|---|
| 2483 | | }; |
|---|
| 2484 | | |
|---|
| 2485 | | } // anonymous namespace |
|---|
| 2486 | | |
|---|
| 2487 | | int |
|---|
| 2488 | | main (int argc, char **argv) |
|---|
| 2489 | | { |
|---|
| 2490 | | int ok = 0; |
|---|
| 2491 | | |
|---|
| 2492 | | assert (argc); |
|---|
| 2493 | | assert (! argv[0]); |
|---|
| 2494 | | { |
|---|
| 2495 | | test_exception_syntax (); |
|---|
| 2496 | | test_template<double> tt (2.0); |
|---|
| 2497 | | assert (tt.add (4) == 6.0); |
|---|
| 2498 | | assert (true && !false); |
|---|
| 2499 | | } |
|---|
| 2500 | | |
|---|
| 2501 | | return ok; |
|---|
| 2502 | | } |
|---|
| 2503 | | |
|---|
| 2504 | configure:16135: result: unsupported |
|---|
| 2505 | configure:16162: checking dependency style of /usr/bin/clang++ |
|---|
| 2506 | configure:16275: result: gcc3 |
|---|
| 2507 | configure:16308: checking how to run the C++ preprocessor |
|---|
| 2508 | configure:16330: /usr/bin/clang++ -E -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp |
|---|
| 2509 | configure:16330: $? = 0 |
|---|
| 2510 | configure:16346: /usr/bin/clang++ -E -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp |
|---|
| 2511 | conftest.cpp:28:10: fatal error: 'ac_nonexistent.h' file not found |
|---|
| 2512 | 28 | #include <ac_nonexistent.h> |
|---|
| 2513 | | ^~~~~~~~~~~~~~~~~~ |
|---|
| 2514 | 1 error generated. |
|---|
| 2515 | configure:16346: $? = 1 |
|---|
| 2516 | configure: failed program was: |
|---|
| 2517 | | /* confdefs.h */ |
|---|
| 2518 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2519 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2520 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2521 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2522 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2523 | | #define PACKAGE_URL "" |
|---|
| 2524 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2525 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2526 | | #define DARWIN 1 |
|---|
| 2527 | | #define DARWIN_DYLIB "" |
|---|
| 2528 | | #define DEFAULT_DPI 96 |
|---|
| 2529 | | #define BROWSER "open" |
|---|
| 2530 | | #define YYTEXT_POINTER 1 |
|---|
| 2531 | | #define HAVE_STDIO_H 1 |
|---|
| 2532 | | #define HAVE_STDLIB_H 1 |
|---|
| 2533 | | #define HAVE_STRING_H 1 |
|---|
| 2534 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2535 | | #define HAVE_STDINT_H 1 |
|---|
| 2536 | | #define HAVE_STRINGS_H 1 |
|---|
| 2537 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2538 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2539 | | #define HAVE_UNISTD_H 1 |
|---|
| 2540 | | #define STDC_HEADERS 1 |
|---|
| 2541 | | #define HAVE_DLFCN_H 1 |
|---|
| 2542 | | #define LT_OBJDIR ".libs/" |
|---|
| 2543 | | /* end confdefs.h. */ |
|---|
| 2544 | | #include <ac_nonexistent.h> |
|---|
| 2545 | configure:16375: result: /usr/bin/clang++ -E |
|---|
| 2546 | configure:16389: /usr/bin/clang++ -E -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp |
|---|
| 2547 | configure:16389: $? = 0 |
|---|
| 2548 | configure:16405: /usr/bin/clang++ -E -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp |
|---|
| 2549 | conftest.cpp:28:10: fatal error: 'ac_nonexistent.h' file not found |
|---|
| 2550 | 28 | #include <ac_nonexistent.h> |
|---|
| 2551 | | ^~~~~~~~~~~~~~~~~~ |
|---|
| 2552 | 1 error generated. |
|---|
| 2553 | configure:16405: $? = 1 |
|---|
| 2554 | configure: failed program was: |
|---|
| 2555 | | /* confdefs.h */ |
|---|
| 2556 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2557 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2558 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2559 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2560 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2561 | | #define PACKAGE_URL "" |
|---|
| 2562 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2563 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2564 | | #define DARWIN 1 |
|---|
| 2565 | | #define DARWIN_DYLIB "" |
|---|
| 2566 | | #define DEFAULT_DPI 96 |
|---|
| 2567 | | #define BROWSER "open" |
|---|
| 2568 | | #define YYTEXT_POINTER 1 |
|---|
| 2569 | | #define HAVE_STDIO_H 1 |
|---|
| 2570 | | #define HAVE_STDLIB_H 1 |
|---|
| 2571 | | #define HAVE_STRING_H 1 |
|---|
| 2572 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2573 | | #define HAVE_STDINT_H 1 |
|---|
| 2574 | | #define HAVE_STRINGS_H 1 |
|---|
| 2575 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2576 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2577 | | #define HAVE_UNISTD_H 1 |
|---|
| 2578 | | #define STDC_HEADERS 1 |
|---|
| 2579 | | #define HAVE_DLFCN_H 1 |
|---|
| 2580 | | #define LT_OBJDIR ".libs/" |
|---|
| 2581 | | /* end confdefs.h. */ |
|---|
| 2582 | | #include <ac_nonexistent.h> |
|---|
| 2583 | configure:16573: checking for ld used by /usr/bin/clang++ |
|---|
| 2584 | configure:16642: result: /Library/Developer/CommandLineTools/usr/bin/ld |
|---|
| 2585 | configure:16649: checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld |
|---|
| 2586 | configure:16666: result: no |
|---|
| 2587 | configure:16720: checking whether the /usr/bin/clang++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries |
|---|
| 2588 | configure:17808: result: yes |
|---|
| 2589 | configure:17844: /usr/bin/clang++ -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2590 | configure:17847: $? = 0 |
|---|
| 2591 | configure:18333: checking for /usr/bin/clang++ option to produce PIC |
|---|
| 2592 | configure:18342: result: -fno-common -DPIC |
|---|
| 2593 | configure:18350: checking if /usr/bin/clang++ PIC flag -fno-common -DPIC works |
|---|
| 2594 | configure:18369: /usr/bin/clang++ -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -fno-common -DPIC -DPIC conftest.cpp >&5 |
|---|
| 2595 | configure:18373: $? = 0 |
|---|
| 2596 | configure:18387: result: yes |
|---|
| 2597 | configure:18410: checking if /usr/bin/clang++ static flag -static works |
|---|
| 2598 | configure:18440: result: no |
|---|
| 2599 | configure:18452: checking if /usr/bin/clang++ supports -c -o file.o |
|---|
| 2600 | configure:18474: /usr/bin/clang++ -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -o out/conftest2.o conftest.cpp >&5 |
|---|
| 2601 | configure:18478: $? = 0 |
|---|
| 2602 | configure:18501: result: yes |
|---|
| 2603 | configure:18506: checking if /usr/bin/clang++ supports -c -o file.o |
|---|
| 2604 | configure:18555: result: yes |
|---|
| 2605 | configure:18585: checking whether the /usr/bin/clang++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries |
|---|
| 2606 | configure:18625: result: yes |
|---|
| 2607 | configure:18768: checking dynamic linker characteristics |
|---|
| 2608 | configure:20062: result: darwin24.3.0 dyld |
|---|
| 2609 | configure:20127: checking how to hardcode library paths into programs |
|---|
| 2610 | configure:20152: result: immediate |
|---|
| 2611 | configure:20206: checking whether /usr/bin/clang++ supports C++17 features with -std=c++17 |
|---|
| 2612 | configure:21003: /usr/bin/clang++ -std=c++17 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 2613 | conftest.cpp:450:10: fatal error: 'initializer_list' file not found |
|---|
| 2614 | 450 | #include <initializer_list> |
|---|
| 2615 | | ^~~~~~~~~~~~~~~~~~ |
|---|
| 2616 | 1 error generated. |
|---|
| 2617 | configure:21003: $? = 1 |
|---|
| 2618 | configure: failed program was: |
|---|
| 2619 | | /* confdefs.h */ |
|---|
| 2620 | | #define PACKAGE_NAME "graphviz" |
|---|
| 2621 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 2622 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 2623 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 2624 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 2625 | | #define PACKAGE_URL "" |
|---|
| 2626 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 2627 | | #define GVPLUGIN_VERSION 6 |
|---|
| 2628 | | #define DARWIN 1 |
|---|
| 2629 | | #define DARWIN_DYLIB "" |
|---|
| 2630 | | #define DEFAULT_DPI 96 |
|---|
| 2631 | | #define BROWSER "open" |
|---|
| 2632 | | #define YYTEXT_POINTER 1 |
|---|
| 2633 | | #define HAVE_STDIO_H 1 |
|---|
| 2634 | | #define HAVE_STDLIB_H 1 |
|---|
| 2635 | | #define HAVE_STRING_H 1 |
|---|
| 2636 | | #define HAVE_INTTYPES_H 1 |
|---|
| 2637 | | #define HAVE_STDINT_H 1 |
|---|
| 2638 | | #define HAVE_STRINGS_H 1 |
|---|
| 2639 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 2640 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 2641 | | #define HAVE_UNISTD_H 1 |
|---|
| 2642 | | #define STDC_HEADERS 1 |
|---|
| 2643 | | #define HAVE_DLFCN_H 1 |
|---|
| 2644 | | #define LT_OBJDIR ".libs/" |
|---|
| 2645 | | /* end confdefs.h. */ |
|---|
| 2646 | | |
|---|
| 2647 | | |
|---|
| 2648 | | // If the compiler admits that it is not ready for C++11, why torture it? |
|---|
| 2649 | | // Hopefully, this will speed up the test. |
|---|
| 2650 | | |
|---|
| 2651 | | #ifndef __cplusplus |
|---|
| 2652 | | |
|---|
| 2653 | | #error "This is not a C++ compiler" |
|---|
| 2654 | | |
|---|
| 2655 | | #elif __cplusplus < 201103L |
|---|
| 2656 | | |
|---|
| 2657 | | #error "This is not a C++11 compiler" |
|---|
| 2658 | | |
|---|
| 2659 | | #else |
|---|
| 2660 | | |
|---|
| 2661 | | namespace cxx11 |
|---|
| 2662 | | { |
|---|
| 2663 | | |
|---|
| 2664 | | namespace test_static_assert |
|---|
| 2665 | | { |
|---|
| 2666 | | |
|---|
| 2667 | | template <typename T> |
|---|
| 2668 | | struct check |
|---|
| 2669 | | { |
|---|
| 2670 | | static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
|---|
| 2671 | | }; |
|---|
| 2672 | | |
|---|
| 2673 | | } |
|---|
| 2674 | | |
|---|
| 2675 | | namespace test_final_override |
|---|
| 2676 | | { |
|---|
| 2677 | | |
|---|
| 2678 | | struct Base |
|---|
| 2679 | | { |
|---|
| 2680 | | virtual ~Base() {} |
|---|
| 2681 | | virtual void f() {} |
|---|
| 2682 | | }; |
|---|
| 2683 | | |
|---|
| 2684 | | struct Derived : public Base |
|---|
| 2685 | | { |
|---|
| 2686 | | virtual ~Derived() override {} |
|---|
| 2687 | | virtual void f() override {} |
|---|
| 2688 | | }; |
|---|
| 2689 | | |
|---|
| 2690 | | } |
|---|
| 2691 | | |
|---|
| 2692 | | namespace test_double_right_angle_brackets |
|---|
| 2693 | | { |
|---|
| 2694 | | |
|---|
| 2695 | | template < typename T > |
|---|
| 2696 | | struct check {}; |
|---|
| 2697 | | |
|---|
| 2698 | | typedef check<void> single_type; |
|---|
| 2699 | | typedef check<check<void>> double_type; |
|---|
| 2700 | | typedef check<check<check<void>>> triple_type; |
|---|
| 2701 | | typedef check<check<check<check<void>>>> quadruple_type; |
|---|
| 2702 | | |
|---|
| 2703 | | } |
|---|
| 2704 | | |
|---|
| 2705 | | namespace test_decltype |
|---|
| 2706 | | { |
|---|
| 2707 | | |
|---|
| 2708 | | int |
|---|
| 2709 | | f() |
|---|
| 2710 | | { |
|---|
| 2711 | | int a = 1; |
|---|
| 2712 | | decltype(a) b = 2; |
|---|
| 2713 | | return a + b; |
|---|
| 2714 | | } |
|---|
| 2715 | | |
|---|
| 2716 | | } |
|---|
| 2717 | | |
|---|
| 2718 | | namespace test_type_deduction |
|---|
| 2719 | | { |
|---|
| 2720 | | |
|---|
| 2721 | | template < typename T1, typename T2 > |
|---|
| 2722 | | struct is_same |
|---|
| 2723 | | { |
|---|
| 2724 | | static const bool value = false; |
|---|
| 2725 | | }; |
|---|
| 2726 | | |
|---|
| 2727 | | template < typename T > |
|---|
| 2728 | | struct is_same<T, T> |
|---|
| 2729 | | { |
|---|
| 2730 | | static const bool value = true; |
|---|
| 2731 | | }; |
|---|
| 2732 | | |
|---|
| 2733 | | template < typename T1, typename T2 > |
|---|
| 2734 | | auto |
|---|
| 2735 | | add(T1 a1, T2 a2) -> decltype(a1 + a2) |
|---|
| 2736 | | { |
|---|
| 2737 | | return a1 + a2; |
|---|
| 2738 | | } |
|---|
| 2739 | | |
|---|
| 2740 | | int |
|---|
| 2741 | | test(const int c, volatile int v) |
|---|
| 2742 | | { |
|---|
| 2743 | | static_assert(is_same<int, decltype(0)>::value == true, ""); |
|---|
| 2744 | | static_assert(is_same<int, decltype(c)>::value == false, ""); |
|---|
| 2745 | | static_assert(is_same<int, decltype(v)>::value == false, ""); |
|---|
| 2746 | | auto ac = c; |
|---|
| 2747 | | auto av = v; |
|---|
| 2748 | | auto sumi = ac + av + 'x'; |
|---|
| 2749 | | auto sumf = ac + av + 1.0; |
|---|
| 2750 | | static_assert(is_same<int, decltype(ac)>::value == true, ""); |
|---|
| 2751 | | static_assert(is_same<int, decltype(av)>::value == true, ""); |
|---|
| 2752 | | static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
|---|
| 2753 | | static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
|---|
| 2754 | | static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
|---|
| 2755 | | return (sumf > 0.0) ? sumi : add(c, v); |
|---|
| 2756 | | } |
|---|
| 2757 | | |
|---|
| 2758 | | } |
|---|
| 2759 | | |
|---|
| 2760 | | namespace test_noexcept |
|---|
| 2761 | | { |
|---|
| 2762 | | |
|---|
| 2763 | | int f() { return 0; } |
|---|
| 2764 | | int g() noexcept { return 0; } |
|---|
| 2765 | | |
|---|
| 2766 | | static_assert(noexcept(f()) == false, ""); |
|---|
| 2767 | | static_assert(noexcept(g()) == true, ""); |
|---|
| 2768 | | |
|---|
| 2769 | | } |
|---|
| 2770 | | |
|---|
| 2771 | | namespace test_constexpr |
|---|
| 2772 | | { |
|---|
| 2773 | | |
|---|
| 2774 | | template < typename CharT > |
|---|
| 2775 | | unsigned long constexpr |
|---|
| 2776 | | strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
|---|
| 2777 | | { |
|---|
| 2778 | | return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
|---|
| 2779 | | } |
|---|
| 2780 | | |
|---|
| 2781 | | template < typename CharT > |
|---|
| 2782 | | unsigned long constexpr |
|---|
| 2783 | | strlen_c(const CharT *const s) noexcept |
|---|
| 2784 | | { |
|---|
| 2785 | | return strlen_c_r(s, 0UL); |
|---|
| 2786 | | } |
|---|
| 2787 | | |
|---|
| 2788 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 2789 | | static_assert(strlen_c("1") == 1UL, ""); |
|---|
| 2790 | | static_assert(strlen_c("example") == 7UL, ""); |
|---|
| 2791 | | static_assert(strlen_c("another\0example") == 7UL, ""); |
|---|
| 2792 | | |
|---|
| 2793 | | } |
|---|
| 2794 | | |
|---|
| 2795 | | namespace test_rvalue_references |
|---|
| 2796 | | { |
|---|
| 2797 | | |
|---|
| 2798 | | template < int N > |
|---|
| 2799 | | struct answer |
|---|
| 2800 | | { |
|---|
| 2801 | | static constexpr int value = N; |
|---|
| 2802 | | }; |
|---|
| 2803 | | |
|---|
| 2804 | | answer<1> f(int&) { return answer<1>(); } |
|---|
| 2805 | | answer<2> f(const int&) { return answer<2>(); } |
|---|
| 2806 | | answer<3> f(int&&) { return answer<3>(); } |
|---|
| 2807 | | |
|---|
| 2808 | | void |
|---|
| 2809 | | test() |
|---|
| 2810 | | { |
|---|
| 2811 | | int i = 0; |
|---|
| 2812 | | const int c = 0; |
|---|
| 2813 | | static_assert(decltype(f(i))::value == 1, ""); |
|---|
| 2814 | | static_assert(decltype(f(c))::value == 2, ""); |
|---|
| 2815 | | static_assert(decltype(f(0))::value == 3, ""); |
|---|
| 2816 | | } |
|---|
| 2817 | | |
|---|
| 2818 | | } |
|---|
| 2819 | | |
|---|
| 2820 | | namespace test_uniform_initialization |
|---|
| 2821 | | { |
|---|
| 2822 | | |
|---|
| 2823 | | struct test |
|---|
| 2824 | | { |
|---|
| 2825 | | static const int zero {}; |
|---|
| 2826 | | static const int one {1}; |
|---|
| 2827 | | }; |
|---|
| 2828 | | |
|---|
| 2829 | | static_assert(test::zero == 0, ""); |
|---|
| 2830 | | static_assert(test::one == 1, ""); |
|---|
| 2831 | | |
|---|
| 2832 | | } |
|---|
| 2833 | | |
|---|
| 2834 | | namespace test_lambdas |
|---|
| 2835 | | { |
|---|
| 2836 | | |
|---|
| 2837 | | void |
|---|
| 2838 | | test1() |
|---|
| 2839 | | { |
|---|
| 2840 | | auto lambda1 = [](){}; |
|---|
| 2841 | | auto lambda2 = lambda1; |
|---|
| 2842 | | lambda1(); |
|---|
| 2843 | | lambda2(); |
|---|
| 2844 | | } |
|---|
| 2845 | | |
|---|
| 2846 | | int |
|---|
| 2847 | | test2() |
|---|
| 2848 | | { |
|---|
| 2849 | | auto a = [](int i, int j){ return i + j; }(1, 2); |
|---|
| 2850 | | auto b = []() -> int { return '0'; }(); |
|---|
| 2851 | | auto c = [=](){ return a + b; }(); |
|---|
| 2852 | | auto d = [&](){ return c; }(); |
|---|
| 2853 | | auto e = [a, &b](int x) mutable { |
|---|
| 2854 | | const auto identity = [](int y){ return y; }; |
|---|
| 2855 | | for (auto i = 0; i < a; ++i) |
|---|
| 2856 | | a += b--; |
|---|
| 2857 | | return x + identity(a + b); |
|---|
| 2858 | | }(0); |
|---|
| 2859 | | return a + b + c + d + e; |
|---|
| 2860 | | } |
|---|
| 2861 | | |
|---|
| 2862 | | int |
|---|
| 2863 | | test3() |
|---|
| 2864 | | { |
|---|
| 2865 | | const auto nullary = [](){ return 0; }; |
|---|
| 2866 | | const auto unary = [](int x){ return x; }; |
|---|
| 2867 | | using nullary_t = decltype(nullary); |
|---|
| 2868 | | using unary_t = decltype(unary); |
|---|
| 2869 | | const auto higher1st = [](nullary_t f){ return f(); }; |
|---|
| 2870 | | const auto higher2nd = [unary](nullary_t f1){ |
|---|
| 2871 | | return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
|---|
| 2872 | | }; |
|---|
| 2873 | | return higher1st(nullary) + higher2nd(nullary)(unary); |
|---|
| 2874 | | } |
|---|
| 2875 | | |
|---|
| 2876 | | } |
|---|
| 2877 | | |
|---|
| 2878 | | namespace test_variadic_templates |
|---|
| 2879 | | { |
|---|
| 2880 | | |
|---|
| 2881 | | template <int...> |
|---|
| 2882 | | struct sum; |
|---|
| 2883 | | |
|---|
| 2884 | | template <int N0, int... N1toN> |
|---|
| 2885 | | struct sum<N0, N1toN...> |
|---|
| 2886 | | { |
|---|
| 2887 | | static constexpr auto value = N0 + sum<N1toN...>::value; |
|---|
| 2888 | | }; |
|---|
| 2889 | | |
|---|
| 2890 | | template <> |
|---|
| 2891 | | struct sum<> |
|---|
| 2892 | | { |
|---|
| 2893 | | static constexpr auto value = 0; |
|---|
| 2894 | | }; |
|---|
| 2895 | | |
|---|
| 2896 | | static_assert(sum<>::value == 0, ""); |
|---|
| 2897 | | static_assert(sum<1>::value == 1, ""); |
|---|
| 2898 | | static_assert(sum<23>::value == 23, ""); |
|---|
| 2899 | | static_assert(sum<1, 2>::value == 3, ""); |
|---|
| 2900 | | static_assert(sum<5, 5, 11>::value == 21, ""); |
|---|
| 2901 | | static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
|---|
| 2902 | | |
|---|
| 2903 | | } |
|---|
| 2904 | | |
|---|
| 2905 | | // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
|---|
| 2906 | | // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
|---|
| 2907 | | // because of this. |
|---|
| 2908 | | namespace test_template_alias_sfinae |
|---|
| 2909 | | { |
|---|
| 2910 | | |
|---|
| 2911 | | struct foo {}; |
|---|
| 2912 | | |
|---|
| 2913 | | template<typename T> |
|---|
| 2914 | | using member = typename T::member_type; |
|---|
| 2915 | | |
|---|
| 2916 | | template<typename T> |
|---|
| 2917 | | void func(...) {} |
|---|
| 2918 | | |
|---|
| 2919 | | template<typename T> |
|---|
| 2920 | | void func(member<T>*) {} |
|---|
| 2921 | | |
|---|
| 2922 | | void test(); |
|---|
| 2923 | | |
|---|
| 2924 | | void test() { func<foo>(0); } |
|---|
| 2925 | | |
|---|
| 2926 | | } |
|---|
| 2927 | | |
|---|
| 2928 | | } // namespace cxx11 |
|---|
| 2929 | | |
|---|
| 2930 | | #endif // __cplusplus >= 201103L |
|---|
| 2931 | | |
|---|
| 2932 | | |
|---|
| 2933 | | |
|---|
| 2934 | | |
|---|
| 2935 | | // If the compiler admits that it is not ready for C++14, why torture it? |
|---|
| 2936 | | // Hopefully, this will speed up the test. |
|---|
| 2937 | | |
|---|
| 2938 | | #ifndef __cplusplus |
|---|
| 2939 | | |
|---|
| 2940 | | #error "This is not a C++ compiler" |
|---|
| 2941 | | |
|---|
| 2942 | | #elif __cplusplus < 201402L |
|---|
| 2943 | | |
|---|
| 2944 | | #error "This is not a C++14 compiler" |
|---|
| 2945 | | |
|---|
| 2946 | | #else |
|---|
| 2947 | | |
|---|
| 2948 | | namespace cxx14 |
|---|
| 2949 | | { |
|---|
| 2950 | | |
|---|
| 2951 | | namespace test_polymorphic_lambdas |
|---|
| 2952 | | { |
|---|
| 2953 | | |
|---|
| 2954 | | int |
|---|
| 2955 | | test() |
|---|
| 2956 | | { |
|---|
| 2957 | | const auto lambda = [](auto&&... args){ |
|---|
| 2958 | | const auto istiny = [](auto x){ |
|---|
| 2959 | | return (sizeof(x) == 1UL) ? 1 : 0; |
|---|
| 2960 | | }; |
|---|
| 2961 | | const int aretiny[] = { istiny(args)... }; |
|---|
| 2962 | | return aretiny[0]; |
|---|
| 2963 | | }; |
|---|
| 2964 | | return lambda(1, 1L, 1.0f, '1'); |
|---|
| 2965 | | } |
|---|
| 2966 | | |
|---|
| 2967 | | } |
|---|
| 2968 | | |
|---|
| 2969 | | namespace test_binary_literals |
|---|
| 2970 | | { |
|---|
| 2971 | | |
|---|
| 2972 | | constexpr auto ivii = 0b0000000000101010; |
|---|
| 2973 | | static_assert(ivii == 42, "wrong value"); |
|---|
| 2974 | | |
|---|
| 2975 | | } |
|---|
| 2976 | | |
|---|
| 2977 | | namespace test_generalized_constexpr |
|---|
| 2978 | | { |
|---|
| 2979 | | |
|---|
| 2980 | | template < typename CharT > |
|---|
| 2981 | | constexpr unsigned long |
|---|
| 2982 | | strlen_c(const CharT *const s) noexcept |
|---|
| 2983 | | { |
|---|
| 2984 | | auto length = 0UL; |
|---|
| 2985 | | for (auto p = s; *p; ++p) |
|---|
| 2986 | | ++length; |
|---|
| 2987 | | return length; |
|---|
| 2988 | | } |
|---|
| 2989 | | |
|---|
| 2990 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 2991 | | static_assert(strlen_c("x") == 1UL, ""); |
|---|
| 2992 | | static_assert(strlen_c("test") == 4UL, ""); |
|---|
| 2993 | | static_assert(strlen_c("another\0test") == 7UL, ""); |
|---|
| 2994 | | |
|---|
| 2995 | | } |
|---|
| 2996 | | |
|---|
| 2997 | | namespace test_lambda_init_capture |
|---|
| 2998 | | { |
|---|
| 2999 | | |
|---|
| 3000 | | int |
|---|
| 3001 | | test() |
|---|
| 3002 | | { |
|---|
| 3003 | | auto x = 0; |
|---|
| 3004 | | const auto lambda1 = [a = x](int b){ return a + b; }; |
|---|
| 3005 | | const auto lambda2 = [a = lambda1(x)](){ return a; }; |
|---|
| 3006 | | return lambda2(); |
|---|
| 3007 | | } |
|---|
| 3008 | | |
|---|
| 3009 | | } |
|---|
| 3010 | | |
|---|
| 3011 | | namespace test_digit_separators |
|---|
| 3012 | | { |
|---|
| 3013 | | |
|---|
| 3014 | | constexpr auto ten_million = 100'000'000; |
|---|
| 3015 | | static_assert(ten_million == 100000000, ""); |
|---|
| 3016 | | |
|---|
| 3017 | | } |
|---|
| 3018 | | |
|---|
| 3019 | | namespace test_return_type_deduction |
|---|
| 3020 | | { |
|---|
| 3021 | | |
|---|
| 3022 | | auto f(int& x) { return x; } |
|---|
| 3023 | | decltype(auto) g(int& x) { return x; } |
|---|
| 3024 | | |
|---|
| 3025 | | template < typename T1, typename T2 > |
|---|
| 3026 | | struct is_same |
|---|
| 3027 | | { |
|---|
| 3028 | | static constexpr auto value = false; |
|---|
| 3029 | | }; |
|---|
| 3030 | | |
|---|
| 3031 | | template < typename T > |
|---|
| 3032 | | struct is_same<T, T> |
|---|
| 3033 | | { |
|---|
| 3034 | | static constexpr auto value = true; |
|---|
| 3035 | | }; |
|---|
| 3036 | | |
|---|
| 3037 | | int |
|---|
| 3038 | | test() |
|---|
| 3039 | | { |
|---|
| 3040 | | auto x = 0; |
|---|
| 3041 | | static_assert(is_same<int, decltype(f(x))>::value, ""); |
|---|
| 3042 | | static_assert(is_same<int&, decltype(g(x))>::value, ""); |
|---|
| 3043 | | return x; |
|---|
| 3044 | | } |
|---|
| 3045 | | |
|---|
| 3046 | | } |
|---|
| 3047 | | |
|---|
| 3048 | | } // namespace cxx14 |
|---|
| 3049 | | |
|---|
| 3050 | | #endif // __cplusplus >= 201402L |
|---|
| 3051 | | |
|---|
| 3052 | | |
|---|
| 3053 | | |
|---|
| 3054 | | |
|---|
| 3055 | | // If the compiler admits that it is not ready for C++17, why torture it? |
|---|
| 3056 | | // Hopefully, this will speed up the test. |
|---|
| 3057 | | |
|---|
| 3058 | | #ifndef __cplusplus |
|---|
| 3059 | | |
|---|
| 3060 | | #error "This is not a C++ compiler" |
|---|
| 3061 | | |
|---|
| 3062 | | #elif __cplusplus < 201703L |
|---|
| 3063 | | |
|---|
| 3064 | | #error "This is not a C++17 compiler" |
|---|
| 3065 | | |
|---|
| 3066 | | #else |
|---|
| 3067 | | |
|---|
| 3068 | | #include <initializer_list> |
|---|
| 3069 | | #include <utility> |
|---|
| 3070 | | #include <type_traits> |
|---|
| 3071 | | |
|---|
| 3072 | | namespace cxx17 |
|---|
| 3073 | | { |
|---|
| 3074 | | |
|---|
| 3075 | | namespace test_constexpr_lambdas |
|---|
| 3076 | | { |
|---|
| 3077 | | |
|---|
| 3078 | | constexpr int foo = [](){return 42;}(); |
|---|
| 3079 | | |
|---|
| 3080 | | } |
|---|
| 3081 | | |
|---|
| 3082 | | namespace test::nested_namespace::definitions |
|---|
| 3083 | | { |
|---|
| 3084 | | |
|---|
| 3085 | | } |
|---|
| 3086 | | |
|---|
| 3087 | | namespace test_fold_expression |
|---|
| 3088 | | { |
|---|
| 3089 | | |
|---|
| 3090 | | template<typename... Args> |
|---|
| 3091 | | int multiply(Args... args) |
|---|
| 3092 | | { |
|---|
| 3093 | | return (args * ... * 1); |
|---|
| 3094 | | } |
|---|
| 3095 | | |
|---|
| 3096 | | template<typename... Args> |
|---|
| 3097 | | bool all(Args... args) |
|---|
| 3098 | | { |
|---|
| 3099 | | return (args && ...); |
|---|
| 3100 | | } |
|---|
| 3101 | | |
|---|
| 3102 | | } |
|---|
| 3103 | | |
|---|
| 3104 | | namespace test_extended_static_assert |
|---|
| 3105 | | { |
|---|
| 3106 | | |
|---|
| 3107 | | static_assert (true); |
|---|
| 3108 | | |
|---|
| 3109 | | } |
|---|
| 3110 | | |
|---|
| 3111 | | namespace test_auto_brace_init_list |
|---|
| 3112 | | { |
|---|
| 3113 | | |
|---|
| 3114 | | auto foo = {5}; |
|---|
| 3115 | | auto bar {5}; |
|---|
| 3116 | | |
|---|
| 3117 | | static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
|---|
| 3118 | | static_assert(std::is_same<int, decltype(bar)>::value); |
|---|
| 3119 | | } |
|---|
| 3120 | | |
|---|
| 3121 | | namespace test_typename_in_template_template_parameter |
|---|
| 3122 | | { |
|---|
| 3123 | | |
|---|
| 3124 | | template<template<typename> typename X> struct D; |
|---|
| 3125 | | |
|---|
| 3126 | | } |
|---|
| 3127 | | |
|---|
| 3128 | | namespace test_fallthrough_nodiscard_maybe_unused_attributes |
|---|
| 3129 | | { |
|---|
| 3130 | | |
|---|
| 3131 | | int f1() |
|---|
| 3132 | | { |
|---|
| 3133 | | return 42; |
|---|
| 3134 | | } |
|---|
| 3135 | | |
|---|
| 3136 | | [[nodiscard]] int f2() |
|---|
| 3137 | | { |
|---|
| 3138 | | [[maybe_unused]] auto unused = f1(); |
|---|
| 3139 | | |
|---|
| 3140 | | switch (f1()) |
|---|
| 3141 | | { |
|---|
| 3142 | | case 17: |
|---|
| 3143 | | f1(); |
|---|
| 3144 | | [[fallthrough]]; |
|---|
| 3145 | | case 42: |
|---|
| 3146 | | f1(); |
|---|
| 3147 | | } |
|---|
| 3148 | | return f1(); |
|---|
| 3149 | | } |
|---|
| 3150 | | |
|---|
| 3151 | | } |
|---|
| 3152 | | |
|---|
| 3153 | | namespace test_extended_aggregate_initialization |
|---|
| 3154 | | { |
|---|
| 3155 | | |
|---|
| 3156 | | struct base1 |
|---|
| 3157 | | { |
|---|
| 3158 | | int b1, b2 = 42; |
|---|
| 3159 | | }; |
|---|
| 3160 | | |
|---|
| 3161 | | struct base2 |
|---|
| 3162 | | { |
|---|
| 3163 | | base2() { |
|---|
| 3164 | | b3 = 42; |
|---|
| 3165 | | } |
|---|
| 3166 | | int b3; |
|---|
| 3167 | | }; |
|---|
| 3168 | | |
|---|
| 3169 | | struct derived : base1, base2 |
|---|
| 3170 | | { |
|---|
| 3171 | | int d; |
|---|
| 3172 | | }; |
|---|
| 3173 | | |
|---|
| 3174 | | derived d1 {{1, 2}, {}, 4}; // full initialization |
|---|
| 3175 | | derived d2 {{}, {}, 4}; // value-initialized bases |
|---|
| 3176 | | |
|---|
| 3177 | | } |
|---|
| 3178 | | |
|---|
| 3179 | | namespace test_general_range_based_for_loop |
|---|
| 3180 | | { |
|---|
| 3181 | | |
|---|
| 3182 | | struct iter |
|---|
| 3183 | | { |
|---|
| 3184 | | int i; |
|---|
| 3185 | | |
|---|
| 3186 | | int& operator* () |
|---|
| 3187 | | { |
|---|
| 3188 | | return i; |
|---|
| 3189 | | } |
|---|
| 3190 | | |
|---|
| 3191 | | const int& operator* () const |
|---|
| 3192 | | { |
|---|
| 3193 | | return i; |
|---|
| 3194 | | } |
|---|
| 3195 | | |
|---|
| 3196 | | iter& operator++() |
|---|
| 3197 | | { |
|---|
| 3198 | | ++i; |
|---|
| 3199 | | return *this; |
|---|
| 3200 | | } |
|---|
| 3201 | | }; |
|---|
| 3202 | | |
|---|
| 3203 | | struct sentinel |
|---|
| 3204 | | { |
|---|
| 3205 | | int i; |
|---|
| 3206 | | }; |
|---|
| 3207 | | |
|---|
| 3208 | | bool operator== (const iter& i, const sentinel& s) |
|---|
| 3209 | | { |
|---|
| 3210 | | return i.i == s.i; |
|---|
| 3211 | | } |
|---|
| 3212 | | |
|---|
| 3213 | | bool operator!= (const iter& i, const sentinel& s) |
|---|
| 3214 | | { |
|---|
| 3215 | | return !(i == s); |
|---|
| 3216 | | } |
|---|
| 3217 | | |
|---|
| 3218 | | struct range |
|---|
| 3219 | | { |
|---|
| 3220 | | iter begin() const |
|---|
| 3221 | | { |
|---|
| 3222 | | return {0}; |
|---|
| 3223 | | } |
|---|
| 3224 | | |
|---|
| 3225 | | sentinel end() const |
|---|
| 3226 | | { |
|---|
| 3227 | | return {5}; |
|---|
| 3228 | | } |
|---|
| 3229 | | }; |
|---|
| 3230 | | |
|---|
| 3231 | | void f() |
|---|
| 3232 | | { |
|---|
| 3233 | | range r {}; |
|---|
| 3234 | | |
|---|
| 3235 | | for (auto i : r) |
|---|
| 3236 | | { |
|---|
| 3237 | | [[maybe_unused]] auto v = i; |
|---|
| 3238 | | } |
|---|
| 3239 | | } |
|---|
| 3240 | | |
|---|
| 3241 | | } |
|---|
| 3242 | | |
|---|
| 3243 | | namespace test_lambda_capture_asterisk_this_by_value |
|---|
| 3244 | | { |
|---|
| 3245 | | |
|---|
| 3246 | | struct t |
|---|
| 3247 | | { |
|---|
| 3248 | | int i; |
|---|
| 3249 | | int foo() |
|---|
| 3250 | | { |
|---|
| 3251 | | return [*this]() |
|---|
| 3252 | | { |
|---|
| 3253 | | return i; |
|---|
| 3254 | | }(); |
|---|
| 3255 | | } |
|---|
| 3256 | | }; |
|---|
| 3257 | | |
|---|
| 3258 | | } |
|---|
| 3259 | | |
|---|
| 3260 | | namespace test_enum_class_construction |
|---|
| 3261 | | { |
|---|
| 3262 | | |
|---|
| 3263 | | enum class byte : unsigned char |
|---|
| 3264 | | {}; |
|---|
| 3265 | | |
|---|
| 3266 | | byte foo {42}; |
|---|
| 3267 | | |
|---|
| 3268 | | } |
|---|
| 3269 | | |
|---|
| 3270 | | namespace test_constexpr_if |
|---|
| 3271 | | { |
|---|
| 3272 | | |
|---|
| 3273 | | template <bool cond> |
|---|
| 3274 | | int f () |
|---|
| 3275 | | { |
|---|
| 3276 | | if constexpr(cond) |
|---|
| 3277 | | { |
|---|
| 3278 | | return 13; |
|---|
| 3279 | | } |
|---|
| 3280 | | else |
|---|
| 3281 | | { |
|---|
| 3282 | | return 42; |
|---|
| 3283 | | } |
|---|
| 3284 | | } |
|---|
| 3285 | | |
|---|
| 3286 | | } |
|---|
| 3287 | | |
|---|
| 3288 | | namespace test_selection_statement_with_initializer |
|---|
| 3289 | | { |
|---|
| 3290 | | |
|---|
| 3291 | | int f() |
|---|
| 3292 | | { |
|---|
| 3293 | | return 13; |
|---|
| 3294 | | } |
|---|
| 3295 | | |
|---|
| 3296 | | int f2() |
|---|
| 3297 | | { |
|---|
| 3298 | | if (auto i = f(); i > 0) |
|---|
| 3299 | | { |
|---|
| 3300 | | return 3; |
|---|
| 3301 | | } |
|---|
| 3302 | | |
|---|
| 3303 | | switch (auto i = f(); i + 4) |
|---|
| 3304 | | { |
|---|
| 3305 | | case 17: |
|---|
| 3306 | | return 2; |
|---|
| 3307 | | |
|---|
| 3308 | | default: |
|---|
| 3309 | | return 1; |
|---|
| 3310 | | } |
|---|
| 3311 | | } |
|---|
| 3312 | | |
|---|
| 3313 | | } |
|---|
| 3314 | | |
|---|
| 3315 | | namespace test_template_argument_deduction_for_class_templates |
|---|
| 3316 | | { |
|---|
| 3317 | | |
|---|
| 3318 | | template <typename T1, typename T2> |
|---|
| 3319 | | struct pair |
|---|
| 3320 | | { |
|---|
| 3321 | | pair (T1 p1, T2 p2) |
|---|
| 3322 | | : m1 {p1}, |
|---|
| 3323 | | m2 {p2} |
|---|
| 3324 | | {} |
|---|
| 3325 | | |
|---|
| 3326 | | T1 m1; |
|---|
| 3327 | | T2 m2; |
|---|
| 3328 | | }; |
|---|
| 3329 | | |
|---|
| 3330 | | void f() |
|---|
| 3331 | | { |
|---|
| 3332 | | [[maybe_unused]] auto p = pair{13, 42u}; |
|---|
| 3333 | | } |
|---|
| 3334 | | |
|---|
| 3335 | | } |
|---|
| 3336 | | |
|---|
| 3337 | | namespace test_non_type_auto_template_parameters |
|---|
| 3338 | | { |
|---|
| 3339 | | |
|---|
| 3340 | | template <auto n> |
|---|
| 3341 | | struct B |
|---|
| 3342 | | {}; |
|---|
| 3343 | | |
|---|
| 3344 | | B<5> b1; |
|---|
| 3345 | | B<'a'> b2; |
|---|
| 3346 | | |
|---|
| 3347 | | } |
|---|
| 3348 | | |
|---|
| 3349 | | namespace test_structured_bindings |
|---|
| 3350 | | { |
|---|
| 3351 | | |
|---|
| 3352 | | int arr[2] = { 1, 2 }; |
|---|
| 3353 | | std::pair<int, int> pr = { 1, 2 }; |
|---|
| 3354 | | |
|---|
| 3355 | | auto f1() -> int(&)[2] |
|---|
| 3356 | | { |
|---|
| 3357 | | return arr; |
|---|
| 3358 | | } |
|---|
| 3359 | | |
|---|
| 3360 | | auto f2() -> std::pair<int, int>& |
|---|
| 3361 | | { |
|---|
| 3362 | | return pr; |
|---|
| 3363 | | } |
|---|
| 3364 | | |
|---|
| 3365 | | struct S |
|---|
| 3366 | | { |
|---|
| 3367 | | int x1 : 2; |
|---|
| 3368 | | volatile double y1; |
|---|
| 3369 | | }; |
|---|
| 3370 | | |
|---|
| 3371 | | S f3() |
|---|
| 3372 | | { |
|---|
| 3373 | | return {}; |
|---|
| 3374 | | } |
|---|
| 3375 | | |
|---|
| 3376 | | auto [ x1, y1 ] = f1(); |
|---|
| 3377 | | auto& [ xr1, yr1 ] = f1(); |
|---|
| 3378 | | auto [ x2, y2 ] = f2(); |
|---|
| 3379 | | auto& [ xr2, yr2 ] = f2(); |
|---|
| 3380 | | const auto [ x3, y3 ] = f3(); |
|---|
| 3381 | | |
|---|
| 3382 | | } |
|---|
| 3383 | | |
|---|
| 3384 | | namespace test_exception_spec_type_system |
|---|
| 3385 | | { |
|---|
| 3386 | | |
|---|
| 3387 | | struct Good {}; |
|---|
| 3388 | | struct Bad {}; |
|---|
| 3389 | | |
|---|
| 3390 | | void g1() noexcept; |
|---|
| 3391 | | void g2(); |
|---|
| 3392 | | |
|---|
| 3393 | | template<typename T> |
|---|
| 3394 | | Bad |
|---|
| 3395 | | f(T*, T*); |
|---|
| 3396 | | |
|---|
| 3397 | | template<typename T1, typename T2> |
|---|
| 3398 | | Good |
|---|
| 3399 | | f(T1*, T2*); |
|---|
| 3400 | | |
|---|
| 3401 | | static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
|---|
| 3402 | | |
|---|
| 3403 | | } |
|---|
| 3404 | | |
|---|
| 3405 | | namespace test_inline_variables |
|---|
| 3406 | | { |
|---|
| 3407 | | |
|---|
| 3408 | | template<class T> void f(T) |
|---|
| 3409 | | {} |
|---|
| 3410 | | |
|---|
| 3411 | | template<class T> inline T g(T) |
|---|
| 3412 | | { |
|---|
| 3413 | | return T{}; |
|---|
| 3414 | | } |
|---|
| 3415 | | |
|---|
| 3416 | | template<> inline void f<>(int) |
|---|
| 3417 | | {} |
|---|
| 3418 | | |
|---|
| 3419 | | template<> int g<>(int) |
|---|
| 3420 | | { |
|---|
| 3421 | | return 5; |
|---|
| 3422 | | } |
|---|
| 3423 | | |
|---|
| 3424 | | } |
|---|
| 3425 | | |
|---|
| 3426 | | } // namespace cxx17 |
|---|
| 3427 | | |
|---|
| 3428 | | #endif // __cplusplus < 201703L |
|---|
| 3429 | | |
|---|
| 3430 | | |
|---|
| 3431 | | |
|---|
| 3432 | configure:21015: result: no |
|---|
| 3433 | configure:20206: checking whether /usr/bin/clang++ supports C++17 features with +std=c++17 |
|---|
| 3434 | configure:21003: /usr/bin/clang++ +std=c++17 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 3435 | clang++: error: no such file or directory: '+std=c++17'; did you mean '-std=c++17'? |
|---|
| 3436 | configure:21003: $? = 1 |
|---|
| 3437 | configure: failed program was: |
|---|
| 3438 | | /* confdefs.h */ |
|---|
| 3439 | | #define PACKAGE_NAME "graphviz" |
|---|
| 3440 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 3441 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 3442 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 3443 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 3444 | | #define PACKAGE_URL "" |
|---|
| 3445 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 3446 | | #define GVPLUGIN_VERSION 6 |
|---|
| 3447 | | #define DARWIN 1 |
|---|
| 3448 | | #define DARWIN_DYLIB "" |
|---|
| 3449 | | #define DEFAULT_DPI 96 |
|---|
| 3450 | | #define BROWSER "open" |
|---|
| 3451 | | #define YYTEXT_POINTER 1 |
|---|
| 3452 | | #define HAVE_STDIO_H 1 |
|---|
| 3453 | | #define HAVE_STDLIB_H 1 |
|---|
| 3454 | | #define HAVE_STRING_H 1 |
|---|
| 3455 | | #define HAVE_INTTYPES_H 1 |
|---|
| 3456 | | #define HAVE_STDINT_H 1 |
|---|
| 3457 | | #define HAVE_STRINGS_H 1 |
|---|
| 3458 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 3459 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 3460 | | #define HAVE_UNISTD_H 1 |
|---|
| 3461 | | #define STDC_HEADERS 1 |
|---|
| 3462 | | #define HAVE_DLFCN_H 1 |
|---|
| 3463 | | #define LT_OBJDIR ".libs/" |
|---|
| 3464 | | /* end confdefs.h. */ |
|---|
| 3465 | | |
|---|
| 3466 | | |
|---|
| 3467 | | // If the compiler admits that it is not ready for C++11, why torture it? |
|---|
| 3468 | | // Hopefully, this will speed up the test. |
|---|
| 3469 | | |
|---|
| 3470 | | #ifndef __cplusplus |
|---|
| 3471 | | |
|---|
| 3472 | | #error "This is not a C++ compiler" |
|---|
| 3473 | | |
|---|
| 3474 | | #elif __cplusplus < 201103L |
|---|
| 3475 | | |
|---|
| 3476 | | #error "This is not a C++11 compiler" |
|---|
| 3477 | | |
|---|
| 3478 | | #else |
|---|
| 3479 | | |
|---|
| 3480 | | namespace cxx11 |
|---|
| 3481 | | { |
|---|
| 3482 | | |
|---|
| 3483 | | namespace test_static_assert |
|---|
| 3484 | | { |
|---|
| 3485 | | |
|---|
| 3486 | | template <typename T> |
|---|
| 3487 | | struct check |
|---|
| 3488 | | { |
|---|
| 3489 | | static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
|---|
| 3490 | | }; |
|---|
| 3491 | | |
|---|
| 3492 | | } |
|---|
| 3493 | | |
|---|
| 3494 | | namespace test_final_override |
|---|
| 3495 | | { |
|---|
| 3496 | | |
|---|
| 3497 | | struct Base |
|---|
| 3498 | | { |
|---|
| 3499 | | virtual ~Base() {} |
|---|
| 3500 | | virtual void f() {} |
|---|
| 3501 | | }; |
|---|
| 3502 | | |
|---|
| 3503 | | struct Derived : public Base |
|---|
| 3504 | | { |
|---|
| 3505 | | virtual ~Derived() override {} |
|---|
| 3506 | | virtual void f() override {} |
|---|
| 3507 | | }; |
|---|
| 3508 | | |
|---|
| 3509 | | } |
|---|
| 3510 | | |
|---|
| 3511 | | namespace test_double_right_angle_brackets |
|---|
| 3512 | | { |
|---|
| 3513 | | |
|---|
| 3514 | | template < typename T > |
|---|
| 3515 | | struct check {}; |
|---|
| 3516 | | |
|---|
| 3517 | | typedef check<void> single_type; |
|---|
| 3518 | | typedef check<check<void>> double_type; |
|---|
| 3519 | | typedef check<check<check<void>>> triple_type; |
|---|
| 3520 | | typedef check<check<check<check<void>>>> quadruple_type; |
|---|
| 3521 | | |
|---|
| 3522 | | } |
|---|
| 3523 | | |
|---|
| 3524 | | namespace test_decltype |
|---|
| 3525 | | { |
|---|
| 3526 | | |
|---|
| 3527 | | int |
|---|
| 3528 | | f() |
|---|
| 3529 | | { |
|---|
| 3530 | | int a = 1; |
|---|
| 3531 | | decltype(a) b = 2; |
|---|
| 3532 | | return a + b; |
|---|
| 3533 | | } |
|---|
| 3534 | | |
|---|
| 3535 | | } |
|---|
| 3536 | | |
|---|
| 3537 | | namespace test_type_deduction |
|---|
| 3538 | | { |
|---|
| 3539 | | |
|---|
| 3540 | | template < typename T1, typename T2 > |
|---|
| 3541 | | struct is_same |
|---|
| 3542 | | { |
|---|
| 3543 | | static const bool value = false; |
|---|
| 3544 | | }; |
|---|
| 3545 | | |
|---|
| 3546 | | template < typename T > |
|---|
| 3547 | | struct is_same<T, T> |
|---|
| 3548 | | { |
|---|
| 3549 | | static const bool value = true; |
|---|
| 3550 | | }; |
|---|
| 3551 | | |
|---|
| 3552 | | template < typename T1, typename T2 > |
|---|
| 3553 | | auto |
|---|
| 3554 | | add(T1 a1, T2 a2) -> decltype(a1 + a2) |
|---|
| 3555 | | { |
|---|
| 3556 | | return a1 + a2; |
|---|
| 3557 | | } |
|---|
| 3558 | | |
|---|
| 3559 | | int |
|---|
| 3560 | | test(const int c, volatile int v) |
|---|
| 3561 | | { |
|---|
| 3562 | | static_assert(is_same<int, decltype(0)>::value == true, ""); |
|---|
| 3563 | | static_assert(is_same<int, decltype(c)>::value == false, ""); |
|---|
| 3564 | | static_assert(is_same<int, decltype(v)>::value == false, ""); |
|---|
| 3565 | | auto ac = c; |
|---|
| 3566 | | auto av = v; |
|---|
| 3567 | | auto sumi = ac + av + 'x'; |
|---|
| 3568 | | auto sumf = ac + av + 1.0; |
|---|
| 3569 | | static_assert(is_same<int, decltype(ac)>::value == true, ""); |
|---|
| 3570 | | static_assert(is_same<int, decltype(av)>::value == true, ""); |
|---|
| 3571 | | static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
|---|
| 3572 | | static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
|---|
| 3573 | | static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
|---|
| 3574 | | return (sumf > 0.0) ? sumi : add(c, v); |
|---|
| 3575 | | } |
|---|
| 3576 | | |
|---|
| 3577 | | } |
|---|
| 3578 | | |
|---|
| 3579 | | namespace test_noexcept |
|---|
| 3580 | | { |
|---|
| 3581 | | |
|---|
| 3582 | | int f() { return 0; } |
|---|
| 3583 | | int g() noexcept { return 0; } |
|---|
| 3584 | | |
|---|
| 3585 | | static_assert(noexcept(f()) == false, ""); |
|---|
| 3586 | | static_assert(noexcept(g()) == true, ""); |
|---|
| 3587 | | |
|---|
| 3588 | | } |
|---|
| 3589 | | |
|---|
| 3590 | | namespace test_constexpr |
|---|
| 3591 | | { |
|---|
| 3592 | | |
|---|
| 3593 | | template < typename CharT > |
|---|
| 3594 | | unsigned long constexpr |
|---|
| 3595 | | strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
|---|
| 3596 | | { |
|---|
| 3597 | | return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
|---|
| 3598 | | } |
|---|
| 3599 | | |
|---|
| 3600 | | template < typename CharT > |
|---|
| 3601 | | unsigned long constexpr |
|---|
| 3602 | | strlen_c(const CharT *const s) noexcept |
|---|
| 3603 | | { |
|---|
| 3604 | | return strlen_c_r(s, 0UL); |
|---|
| 3605 | | } |
|---|
| 3606 | | |
|---|
| 3607 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 3608 | | static_assert(strlen_c("1") == 1UL, ""); |
|---|
| 3609 | | static_assert(strlen_c("example") == 7UL, ""); |
|---|
| 3610 | | static_assert(strlen_c("another\0example") == 7UL, ""); |
|---|
| 3611 | | |
|---|
| 3612 | | } |
|---|
| 3613 | | |
|---|
| 3614 | | namespace test_rvalue_references |
|---|
| 3615 | | { |
|---|
| 3616 | | |
|---|
| 3617 | | template < int N > |
|---|
| 3618 | | struct answer |
|---|
| 3619 | | { |
|---|
| 3620 | | static constexpr int value = N; |
|---|
| 3621 | | }; |
|---|
| 3622 | | |
|---|
| 3623 | | answer<1> f(int&) { return answer<1>(); } |
|---|
| 3624 | | answer<2> f(const int&) { return answer<2>(); } |
|---|
| 3625 | | answer<3> f(int&&) { return answer<3>(); } |
|---|
| 3626 | | |
|---|
| 3627 | | void |
|---|
| 3628 | | test() |
|---|
| 3629 | | { |
|---|
| 3630 | | int i = 0; |
|---|
| 3631 | | const int c = 0; |
|---|
| 3632 | | static_assert(decltype(f(i))::value == 1, ""); |
|---|
| 3633 | | static_assert(decltype(f(c))::value == 2, ""); |
|---|
| 3634 | | static_assert(decltype(f(0))::value == 3, ""); |
|---|
| 3635 | | } |
|---|
| 3636 | | |
|---|
| 3637 | | } |
|---|
| 3638 | | |
|---|
| 3639 | | namespace test_uniform_initialization |
|---|
| 3640 | | { |
|---|
| 3641 | | |
|---|
| 3642 | | struct test |
|---|
| 3643 | | { |
|---|
| 3644 | | static const int zero {}; |
|---|
| 3645 | | static const int one {1}; |
|---|
| 3646 | | }; |
|---|
| 3647 | | |
|---|
| 3648 | | static_assert(test::zero == 0, ""); |
|---|
| 3649 | | static_assert(test::one == 1, ""); |
|---|
| 3650 | | |
|---|
| 3651 | | } |
|---|
| 3652 | | |
|---|
| 3653 | | namespace test_lambdas |
|---|
| 3654 | | { |
|---|
| 3655 | | |
|---|
| 3656 | | void |
|---|
| 3657 | | test1() |
|---|
| 3658 | | { |
|---|
| 3659 | | auto lambda1 = [](){}; |
|---|
| 3660 | | auto lambda2 = lambda1; |
|---|
| 3661 | | lambda1(); |
|---|
| 3662 | | lambda2(); |
|---|
| 3663 | | } |
|---|
| 3664 | | |
|---|
| 3665 | | int |
|---|
| 3666 | | test2() |
|---|
| 3667 | | { |
|---|
| 3668 | | auto a = [](int i, int j){ return i + j; }(1, 2); |
|---|
| 3669 | | auto b = []() -> int { return '0'; }(); |
|---|
| 3670 | | auto c = [=](){ return a + b; }(); |
|---|
| 3671 | | auto d = [&](){ return c; }(); |
|---|
| 3672 | | auto e = [a, &b](int x) mutable { |
|---|
| 3673 | | const auto identity = [](int y){ return y; }; |
|---|
| 3674 | | for (auto i = 0; i < a; ++i) |
|---|
| 3675 | | a += b--; |
|---|
| 3676 | | return x + identity(a + b); |
|---|
| 3677 | | }(0); |
|---|
| 3678 | | return a + b + c + d + e; |
|---|
| 3679 | | } |
|---|
| 3680 | | |
|---|
| 3681 | | int |
|---|
| 3682 | | test3() |
|---|
| 3683 | | { |
|---|
| 3684 | | const auto nullary = [](){ return 0; }; |
|---|
| 3685 | | const auto unary = [](int x){ return x; }; |
|---|
| 3686 | | using nullary_t = decltype(nullary); |
|---|
| 3687 | | using unary_t = decltype(unary); |
|---|
| 3688 | | const auto higher1st = [](nullary_t f){ return f(); }; |
|---|
| 3689 | | const auto higher2nd = [unary](nullary_t f1){ |
|---|
| 3690 | | return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
|---|
| 3691 | | }; |
|---|
| 3692 | | return higher1st(nullary) + higher2nd(nullary)(unary); |
|---|
| 3693 | | } |
|---|
| 3694 | | |
|---|
| 3695 | | } |
|---|
| 3696 | | |
|---|
| 3697 | | namespace test_variadic_templates |
|---|
| 3698 | | { |
|---|
| 3699 | | |
|---|
| 3700 | | template <int...> |
|---|
| 3701 | | struct sum; |
|---|
| 3702 | | |
|---|
| 3703 | | template <int N0, int... N1toN> |
|---|
| 3704 | | struct sum<N0, N1toN...> |
|---|
| 3705 | | { |
|---|
| 3706 | | static constexpr auto value = N0 + sum<N1toN...>::value; |
|---|
| 3707 | | }; |
|---|
| 3708 | | |
|---|
| 3709 | | template <> |
|---|
| 3710 | | struct sum<> |
|---|
| 3711 | | { |
|---|
| 3712 | | static constexpr auto value = 0; |
|---|
| 3713 | | }; |
|---|
| 3714 | | |
|---|
| 3715 | | static_assert(sum<>::value == 0, ""); |
|---|
| 3716 | | static_assert(sum<1>::value == 1, ""); |
|---|
| 3717 | | static_assert(sum<23>::value == 23, ""); |
|---|
| 3718 | | static_assert(sum<1, 2>::value == 3, ""); |
|---|
| 3719 | | static_assert(sum<5, 5, 11>::value == 21, ""); |
|---|
| 3720 | | static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
|---|
| 3721 | | |
|---|
| 3722 | | } |
|---|
| 3723 | | |
|---|
| 3724 | | // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
|---|
| 3725 | | // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
|---|
| 3726 | | // because of this. |
|---|
| 3727 | | namespace test_template_alias_sfinae |
|---|
| 3728 | | { |
|---|
| 3729 | | |
|---|
| 3730 | | struct foo {}; |
|---|
| 3731 | | |
|---|
| 3732 | | template<typename T> |
|---|
| 3733 | | using member = typename T::member_type; |
|---|
| 3734 | | |
|---|
| 3735 | | template<typename T> |
|---|
| 3736 | | void func(...) {} |
|---|
| 3737 | | |
|---|
| 3738 | | template<typename T> |
|---|
| 3739 | | void func(member<T>*) {} |
|---|
| 3740 | | |
|---|
| 3741 | | void test(); |
|---|
| 3742 | | |
|---|
| 3743 | | void test() { func<foo>(0); } |
|---|
| 3744 | | |
|---|
| 3745 | | } |
|---|
| 3746 | | |
|---|
| 3747 | | } // namespace cxx11 |
|---|
| 3748 | | |
|---|
| 3749 | | #endif // __cplusplus >= 201103L |
|---|
| 3750 | | |
|---|
| 3751 | | |
|---|
| 3752 | | |
|---|
| 3753 | | |
|---|
| 3754 | | // If the compiler admits that it is not ready for C++14, why torture it? |
|---|
| 3755 | | // Hopefully, this will speed up the test. |
|---|
| 3756 | | |
|---|
| 3757 | | #ifndef __cplusplus |
|---|
| 3758 | | |
|---|
| 3759 | | #error "This is not a C++ compiler" |
|---|
| 3760 | | |
|---|
| 3761 | | #elif __cplusplus < 201402L |
|---|
| 3762 | | |
|---|
| 3763 | | #error "This is not a C++14 compiler" |
|---|
| 3764 | | |
|---|
| 3765 | | #else |
|---|
| 3766 | | |
|---|
| 3767 | | namespace cxx14 |
|---|
| 3768 | | { |
|---|
| 3769 | | |
|---|
| 3770 | | namespace test_polymorphic_lambdas |
|---|
| 3771 | | { |
|---|
| 3772 | | |
|---|
| 3773 | | int |
|---|
| 3774 | | test() |
|---|
| 3775 | | { |
|---|
| 3776 | | const auto lambda = [](auto&&... args){ |
|---|
| 3777 | | const auto istiny = [](auto x){ |
|---|
| 3778 | | return (sizeof(x) == 1UL) ? 1 : 0; |
|---|
| 3779 | | }; |
|---|
| 3780 | | const int aretiny[] = { istiny(args)... }; |
|---|
| 3781 | | return aretiny[0]; |
|---|
| 3782 | | }; |
|---|
| 3783 | | return lambda(1, 1L, 1.0f, '1'); |
|---|
| 3784 | | } |
|---|
| 3785 | | |
|---|
| 3786 | | } |
|---|
| 3787 | | |
|---|
| 3788 | | namespace test_binary_literals |
|---|
| 3789 | | { |
|---|
| 3790 | | |
|---|
| 3791 | | constexpr auto ivii = 0b0000000000101010; |
|---|
| 3792 | | static_assert(ivii == 42, "wrong value"); |
|---|
| 3793 | | |
|---|
| 3794 | | } |
|---|
| 3795 | | |
|---|
| 3796 | | namespace test_generalized_constexpr |
|---|
| 3797 | | { |
|---|
| 3798 | | |
|---|
| 3799 | | template < typename CharT > |
|---|
| 3800 | | constexpr unsigned long |
|---|
| 3801 | | strlen_c(const CharT *const s) noexcept |
|---|
| 3802 | | { |
|---|
| 3803 | | auto length = 0UL; |
|---|
| 3804 | | for (auto p = s; *p; ++p) |
|---|
| 3805 | | ++length; |
|---|
| 3806 | | return length; |
|---|
| 3807 | | } |
|---|
| 3808 | | |
|---|
| 3809 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 3810 | | static_assert(strlen_c("x") == 1UL, ""); |
|---|
| 3811 | | static_assert(strlen_c("test") == 4UL, ""); |
|---|
| 3812 | | static_assert(strlen_c("another\0test") == 7UL, ""); |
|---|
| 3813 | | |
|---|
| 3814 | | } |
|---|
| 3815 | | |
|---|
| 3816 | | namespace test_lambda_init_capture |
|---|
| 3817 | | { |
|---|
| 3818 | | |
|---|
| 3819 | | int |
|---|
| 3820 | | test() |
|---|
| 3821 | | { |
|---|
| 3822 | | auto x = 0; |
|---|
| 3823 | | const auto lambda1 = [a = x](int b){ return a + b; }; |
|---|
| 3824 | | const auto lambda2 = [a = lambda1(x)](){ return a; }; |
|---|
| 3825 | | return lambda2(); |
|---|
| 3826 | | } |
|---|
| 3827 | | |
|---|
| 3828 | | } |
|---|
| 3829 | | |
|---|
| 3830 | | namespace test_digit_separators |
|---|
| 3831 | | { |
|---|
| 3832 | | |
|---|
| 3833 | | constexpr auto ten_million = 100'000'000; |
|---|
| 3834 | | static_assert(ten_million == 100000000, ""); |
|---|
| 3835 | | |
|---|
| 3836 | | } |
|---|
| 3837 | | |
|---|
| 3838 | | namespace test_return_type_deduction |
|---|
| 3839 | | { |
|---|
| 3840 | | |
|---|
| 3841 | | auto f(int& x) { return x; } |
|---|
| 3842 | | decltype(auto) g(int& x) { return x; } |
|---|
| 3843 | | |
|---|
| 3844 | | template < typename T1, typename T2 > |
|---|
| 3845 | | struct is_same |
|---|
| 3846 | | { |
|---|
| 3847 | | static constexpr auto value = false; |
|---|
| 3848 | | }; |
|---|
| 3849 | | |
|---|
| 3850 | | template < typename T > |
|---|
| 3851 | | struct is_same<T, T> |
|---|
| 3852 | | { |
|---|
| 3853 | | static constexpr auto value = true; |
|---|
| 3854 | | }; |
|---|
| 3855 | | |
|---|
| 3856 | | int |
|---|
| 3857 | | test() |
|---|
| 3858 | | { |
|---|
| 3859 | | auto x = 0; |
|---|
| 3860 | | static_assert(is_same<int, decltype(f(x))>::value, ""); |
|---|
| 3861 | | static_assert(is_same<int&, decltype(g(x))>::value, ""); |
|---|
| 3862 | | return x; |
|---|
| 3863 | | } |
|---|
| 3864 | | |
|---|
| 3865 | | } |
|---|
| 3866 | | |
|---|
| 3867 | | } // namespace cxx14 |
|---|
| 3868 | | |
|---|
| 3869 | | #endif // __cplusplus >= 201402L |
|---|
| 3870 | | |
|---|
| 3871 | | |
|---|
| 3872 | | |
|---|
| 3873 | | |
|---|
| 3874 | | // If the compiler admits that it is not ready for C++17, why torture it? |
|---|
| 3875 | | // Hopefully, this will speed up the test. |
|---|
| 3876 | | |
|---|
| 3877 | | #ifndef __cplusplus |
|---|
| 3878 | | |
|---|
| 3879 | | #error "This is not a C++ compiler" |
|---|
| 3880 | | |
|---|
| 3881 | | #elif __cplusplus < 201703L |
|---|
| 3882 | | |
|---|
| 3883 | | #error "This is not a C++17 compiler" |
|---|
| 3884 | | |
|---|
| 3885 | | #else |
|---|
| 3886 | | |
|---|
| 3887 | | #include <initializer_list> |
|---|
| 3888 | | #include <utility> |
|---|
| 3889 | | #include <type_traits> |
|---|
| 3890 | | |
|---|
| 3891 | | namespace cxx17 |
|---|
| 3892 | | { |
|---|
| 3893 | | |
|---|
| 3894 | | namespace test_constexpr_lambdas |
|---|
| 3895 | | { |
|---|
| 3896 | | |
|---|
| 3897 | | constexpr int foo = [](){return 42;}(); |
|---|
| 3898 | | |
|---|
| 3899 | | } |
|---|
| 3900 | | |
|---|
| 3901 | | namespace test::nested_namespace::definitions |
|---|
| 3902 | | { |
|---|
| 3903 | | |
|---|
| 3904 | | } |
|---|
| 3905 | | |
|---|
| 3906 | | namespace test_fold_expression |
|---|
| 3907 | | { |
|---|
| 3908 | | |
|---|
| 3909 | | template<typename... Args> |
|---|
| 3910 | | int multiply(Args... args) |
|---|
| 3911 | | { |
|---|
| 3912 | | return (args * ... * 1); |
|---|
| 3913 | | } |
|---|
| 3914 | | |
|---|
| 3915 | | template<typename... Args> |
|---|
| 3916 | | bool all(Args... args) |
|---|
| 3917 | | { |
|---|
| 3918 | | return (args && ...); |
|---|
| 3919 | | } |
|---|
| 3920 | | |
|---|
| 3921 | | } |
|---|
| 3922 | | |
|---|
| 3923 | | namespace test_extended_static_assert |
|---|
| 3924 | | { |
|---|
| 3925 | | |
|---|
| 3926 | | static_assert (true); |
|---|
| 3927 | | |
|---|
| 3928 | | } |
|---|
| 3929 | | |
|---|
| 3930 | | namespace test_auto_brace_init_list |
|---|
| 3931 | | { |
|---|
| 3932 | | |
|---|
| 3933 | | auto foo = {5}; |
|---|
| 3934 | | auto bar {5}; |
|---|
| 3935 | | |
|---|
| 3936 | | static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
|---|
| 3937 | | static_assert(std::is_same<int, decltype(bar)>::value); |
|---|
| 3938 | | } |
|---|
| 3939 | | |
|---|
| 3940 | | namespace test_typename_in_template_template_parameter |
|---|
| 3941 | | { |
|---|
| 3942 | | |
|---|
| 3943 | | template<template<typename> typename X> struct D; |
|---|
| 3944 | | |
|---|
| 3945 | | } |
|---|
| 3946 | | |
|---|
| 3947 | | namespace test_fallthrough_nodiscard_maybe_unused_attributes |
|---|
| 3948 | | { |
|---|
| 3949 | | |
|---|
| 3950 | | int f1() |
|---|
| 3951 | | { |
|---|
| 3952 | | return 42; |
|---|
| 3953 | | } |
|---|
| 3954 | | |
|---|
| 3955 | | [[nodiscard]] int f2() |
|---|
| 3956 | | { |
|---|
| 3957 | | [[maybe_unused]] auto unused = f1(); |
|---|
| 3958 | | |
|---|
| 3959 | | switch (f1()) |
|---|
| 3960 | | { |
|---|
| 3961 | | case 17: |
|---|
| 3962 | | f1(); |
|---|
| 3963 | | [[fallthrough]]; |
|---|
| 3964 | | case 42: |
|---|
| 3965 | | f1(); |
|---|
| 3966 | | } |
|---|
| 3967 | | return f1(); |
|---|
| 3968 | | } |
|---|
| 3969 | | |
|---|
| 3970 | | } |
|---|
| 3971 | | |
|---|
| 3972 | | namespace test_extended_aggregate_initialization |
|---|
| 3973 | | { |
|---|
| 3974 | | |
|---|
| 3975 | | struct base1 |
|---|
| 3976 | | { |
|---|
| 3977 | | int b1, b2 = 42; |
|---|
| 3978 | | }; |
|---|
| 3979 | | |
|---|
| 3980 | | struct base2 |
|---|
| 3981 | | { |
|---|
| 3982 | | base2() { |
|---|
| 3983 | | b3 = 42; |
|---|
| 3984 | | } |
|---|
| 3985 | | int b3; |
|---|
| 3986 | | }; |
|---|
| 3987 | | |
|---|
| 3988 | | struct derived : base1, base2 |
|---|
| 3989 | | { |
|---|
| 3990 | | int d; |
|---|
| 3991 | | }; |
|---|
| 3992 | | |
|---|
| 3993 | | derived d1 {{1, 2}, {}, 4}; // full initialization |
|---|
| 3994 | | derived d2 {{}, {}, 4}; // value-initialized bases |
|---|
| 3995 | | |
|---|
| 3996 | | } |
|---|
| 3997 | | |
|---|
| 3998 | | namespace test_general_range_based_for_loop |
|---|
| 3999 | | { |
|---|
| 4000 | | |
|---|
| 4001 | | struct iter |
|---|
| 4002 | | { |
|---|
| 4003 | | int i; |
|---|
| 4004 | | |
|---|
| 4005 | | int& operator* () |
|---|
| 4006 | | { |
|---|
| 4007 | | return i; |
|---|
| 4008 | | } |
|---|
| 4009 | | |
|---|
| 4010 | | const int& operator* () const |
|---|
| 4011 | | { |
|---|
| 4012 | | return i; |
|---|
| 4013 | | } |
|---|
| 4014 | | |
|---|
| 4015 | | iter& operator++() |
|---|
| 4016 | | { |
|---|
| 4017 | | ++i; |
|---|
| 4018 | | return *this; |
|---|
| 4019 | | } |
|---|
| 4020 | | }; |
|---|
| 4021 | | |
|---|
| 4022 | | struct sentinel |
|---|
| 4023 | | { |
|---|
| 4024 | | int i; |
|---|
| 4025 | | }; |
|---|
| 4026 | | |
|---|
| 4027 | | bool operator== (const iter& i, const sentinel& s) |
|---|
| 4028 | | { |
|---|
| 4029 | | return i.i == s.i; |
|---|
| 4030 | | } |
|---|
| 4031 | | |
|---|
| 4032 | | bool operator!= (const iter& i, const sentinel& s) |
|---|
| 4033 | | { |
|---|
| 4034 | | return !(i == s); |
|---|
| 4035 | | } |
|---|
| 4036 | | |
|---|
| 4037 | | struct range |
|---|
| 4038 | | { |
|---|
| 4039 | | iter begin() const |
|---|
| 4040 | | { |
|---|
| 4041 | | return {0}; |
|---|
| 4042 | | } |
|---|
| 4043 | | |
|---|
| 4044 | | sentinel end() const |
|---|
| 4045 | | { |
|---|
| 4046 | | return {5}; |
|---|
| 4047 | | } |
|---|
| 4048 | | }; |
|---|
| 4049 | | |
|---|
| 4050 | | void f() |
|---|
| 4051 | | { |
|---|
| 4052 | | range r {}; |
|---|
| 4053 | | |
|---|
| 4054 | | for (auto i : r) |
|---|
| 4055 | | { |
|---|
| 4056 | | [[maybe_unused]] auto v = i; |
|---|
| 4057 | | } |
|---|
| 4058 | | } |
|---|
| 4059 | | |
|---|
| 4060 | | } |
|---|
| 4061 | | |
|---|
| 4062 | | namespace test_lambda_capture_asterisk_this_by_value |
|---|
| 4063 | | { |
|---|
| 4064 | | |
|---|
| 4065 | | struct t |
|---|
| 4066 | | { |
|---|
| 4067 | | int i; |
|---|
| 4068 | | int foo() |
|---|
| 4069 | | { |
|---|
| 4070 | | return [*this]() |
|---|
| 4071 | | { |
|---|
| 4072 | | return i; |
|---|
| 4073 | | }(); |
|---|
| 4074 | | } |
|---|
| 4075 | | }; |
|---|
| 4076 | | |
|---|
| 4077 | | } |
|---|
| 4078 | | |
|---|
| 4079 | | namespace test_enum_class_construction |
|---|
| 4080 | | { |
|---|
| 4081 | | |
|---|
| 4082 | | enum class byte : unsigned char |
|---|
| 4083 | | {}; |
|---|
| 4084 | | |
|---|
| 4085 | | byte foo {42}; |
|---|
| 4086 | | |
|---|
| 4087 | | } |
|---|
| 4088 | | |
|---|
| 4089 | | namespace test_constexpr_if |
|---|
| 4090 | | { |
|---|
| 4091 | | |
|---|
| 4092 | | template <bool cond> |
|---|
| 4093 | | int f () |
|---|
| 4094 | | { |
|---|
| 4095 | | if constexpr(cond) |
|---|
| 4096 | | { |
|---|
| 4097 | | return 13; |
|---|
| 4098 | | } |
|---|
| 4099 | | else |
|---|
| 4100 | | { |
|---|
| 4101 | | return 42; |
|---|
| 4102 | | } |
|---|
| 4103 | | } |
|---|
| 4104 | | |
|---|
| 4105 | | } |
|---|
| 4106 | | |
|---|
| 4107 | | namespace test_selection_statement_with_initializer |
|---|
| 4108 | | { |
|---|
| 4109 | | |
|---|
| 4110 | | int f() |
|---|
| 4111 | | { |
|---|
| 4112 | | return 13; |
|---|
| 4113 | | } |
|---|
| 4114 | | |
|---|
| 4115 | | int f2() |
|---|
| 4116 | | { |
|---|
| 4117 | | if (auto i = f(); i > 0) |
|---|
| 4118 | | { |
|---|
| 4119 | | return 3; |
|---|
| 4120 | | } |
|---|
| 4121 | | |
|---|
| 4122 | | switch (auto i = f(); i + 4) |
|---|
| 4123 | | { |
|---|
| 4124 | | case 17: |
|---|
| 4125 | | return 2; |
|---|
| 4126 | | |
|---|
| 4127 | | default: |
|---|
| 4128 | | return 1; |
|---|
| 4129 | | } |
|---|
| 4130 | | } |
|---|
| 4131 | | |
|---|
| 4132 | | } |
|---|
| 4133 | | |
|---|
| 4134 | | namespace test_template_argument_deduction_for_class_templates |
|---|
| 4135 | | { |
|---|
| 4136 | | |
|---|
| 4137 | | template <typename T1, typename T2> |
|---|
| 4138 | | struct pair |
|---|
| 4139 | | { |
|---|
| 4140 | | pair (T1 p1, T2 p2) |
|---|
| 4141 | | : m1 {p1}, |
|---|
| 4142 | | m2 {p2} |
|---|
| 4143 | | {} |
|---|
| 4144 | | |
|---|
| 4145 | | T1 m1; |
|---|
| 4146 | | T2 m2; |
|---|
| 4147 | | }; |
|---|
| 4148 | | |
|---|
| 4149 | | void f() |
|---|
| 4150 | | { |
|---|
| 4151 | | [[maybe_unused]] auto p = pair{13, 42u}; |
|---|
| 4152 | | } |
|---|
| 4153 | | |
|---|
| 4154 | | } |
|---|
| 4155 | | |
|---|
| 4156 | | namespace test_non_type_auto_template_parameters |
|---|
| 4157 | | { |
|---|
| 4158 | | |
|---|
| 4159 | | template <auto n> |
|---|
| 4160 | | struct B |
|---|
| 4161 | | {}; |
|---|
| 4162 | | |
|---|
| 4163 | | B<5> b1; |
|---|
| 4164 | | B<'a'> b2; |
|---|
| 4165 | | |
|---|
| 4166 | | } |
|---|
| 4167 | | |
|---|
| 4168 | | namespace test_structured_bindings |
|---|
| 4169 | | { |
|---|
| 4170 | | |
|---|
| 4171 | | int arr[2] = { 1, 2 }; |
|---|
| 4172 | | std::pair<int, int> pr = { 1, 2 }; |
|---|
| 4173 | | |
|---|
| 4174 | | auto f1() -> int(&)[2] |
|---|
| 4175 | | { |
|---|
| 4176 | | return arr; |
|---|
| 4177 | | } |
|---|
| 4178 | | |
|---|
| 4179 | | auto f2() -> std::pair<int, int>& |
|---|
| 4180 | | { |
|---|
| 4181 | | return pr; |
|---|
| 4182 | | } |
|---|
| 4183 | | |
|---|
| 4184 | | struct S |
|---|
| 4185 | | { |
|---|
| 4186 | | int x1 : 2; |
|---|
| 4187 | | volatile double y1; |
|---|
| 4188 | | }; |
|---|
| 4189 | | |
|---|
| 4190 | | S f3() |
|---|
| 4191 | | { |
|---|
| 4192 | | return {}; |
|---|
| 4193 | | } |
|---|
| 4194 | | |
|---|
| 4195 | | auto [ x1, y1 ] = f1(); |
|---|
| 4196 | | auto& [ xr1, yr1 ] = f1(); |
|---|
| 4197 | | auto [ x2, y2 ] = f2(); |
|---|
| 4198 | | auto& [ xr2, yr2 ] = f2(); |
|---|
| 4199 | | const auto [ x3, y3 ] = f3(); |
|---|
| 4200 | | |
|---|
| 4201 | | } |
|---|
| 4202 | | |
|---|
| 4203 | | namespace test_exception_spec_type_system |
|---|
| 4204 | | { |
|---|
| 4205 | | |
|---|
| 4206 | | struct Good {}; |
|---|
| 4207 | | struct Bad {}; |
|---|
| 4208 | | |
|---|
| 4209 | | void g1() noexcept; |
|---|
| 4210 | | void g2(); |
|---|
| 4211 | | |
|---|
| 4212 | | template<typename T> |
|---|
| 4213 | | Bad |
|---|
| 4214 | | f(T*, T*); |
|---|
| 4215 | | |
|---|
| 4216 | | template<typename T1, typename T2> |
|---|
| 4217 | | Good |
|---|
| 4218 | | f(T1*, T2*); |
|---|
| 4219 | | |
|---|
| 4220 | | static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
|---|
| 4221 | | |
|---|
| 4222 | | } |
|---|
| 4223 | | |
|---|
| 4224 | | namespace test_inline_variables |
|---|
| 4225 | | { |
|---|
| 4226 | | |
|---|
| 4227 | | template<class T> void f(T) |
|---|
| 4228 | | {} |
|---|
| 4229 | | |
|---|
| 4230 | | template<class T> inline T g(T) |
|---|
| 4231 | | { |
|---|
| 4232 | | return T{}; |
|---|
| 4233 | | } |
|---|
| 4234 | | |
|---|
| 4235 | | template<> inline void f<>(int) |
|---|
| 4236 | | {} |
|---|
| 4237 | | |
|---|
| 4238 | | template<> int g<>(int) |
|---|
| 4239 | | { |
|---|
| 4240 | | return 5; |
|---|
| 4241 | | } |
|---|
| 4242 | | |
|---|
| 4243 | | } |
|---|
| 4244 | | |
|---|
| 4245 | | } // namespace cxx17 |
|---|
| 4246 | | |
|---|
| 4247 | | #endif // __cplusplus < 201703L |
|---|
| 4248 | | |
|---|
| 4249 | | |
|---|
| 4250 | | |
|---|
| 4251 | configure:21015: result: no |
|---|
| 4252 | configure:20206: checking whether /usr/bin/clang++ supports C++17 features with -h std=c++17 |
|---|
| 4253 | configure:21003: /usr/bin/clang++ -h std=c++17 -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 4254 | clang++: error: unknown argument: '-h' |
|---|
| 4255 | clang++: error: no such file or directory: 'std=c++17'; did you mean '-std=c++17'? |
|---|
| 4256 | configure:21003: $? = 1 |
|---|
| 4257 | configure: failed program was: |
|---|
| 4258 | | /* confdefs.h */ |
|---|
| 4259 | | #define PACKAGE_NAME "graphviz" |
|---|
| 4260 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 4261 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 4262 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 4263 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 4264 | | #define PACKAGE_URL "" |
|---|
| 4265 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 4266 | | #define GVPLUGIN_VERSION 6 |
|---|
| 4267 | | #define DARWIN 1 |
|---|
| 4268 | | #define DARWIN_DYLIB "" |
|---|
| 4269 | | #define DEFAULT_DPI 96 |
|---|
| 4270 | | #define BROWSER "open" |
|---|
| 4271 | | #define YYTEXT_POINTER 1 |
|---|
| 4272 | | #define HAVE_STDIO_H 1 |
|---|
| 4273 | | #define HAVE_STDLIB_H 1 |
|---|
| 4274 | | #define HAVE_STRING_H 1 |
|---|
| 4275 | | #define HAVE_INTTYPES_H 1 |
|---|
| 4276 | | #define HAVE_STDINT_H 1 |
|---|
| 4277 | | #define HAVE_STRINGS_H 1 |
|---|
| 4278 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 4279 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 4280 | | #define HAVE_UNISTD_H 1 |
|---|
| 4281 | | #define STDC_HEADERS 1 |
|---|
| 4282 | | #define HAVE_DLFCN_H 1 |
|---|
| 4283 | | #define LT_OBJDIR ".libs/" |
|---|
| 4284 | | /* end confdefs.h. */ |
|---|
| 4285 | | |
|---|
| 4286 | | |
|---|
| 4287 | | // If the compiler admits that it is not ready for C++11, why torture it? |
|---|
| 4288 | | // Hopefully, this will speed up the test. |
|---|
| 4289 | | |
|---|
| 4290 | | #ifndef __cplusplus |
|---|
| 4291 | | |
|---|
| 4292 | | #error "This is not a C++ compiler" |
|---|
| 4293 | | |
|---|
| 4294 | | #elif __cplusplus < 201103L |
|---|
| 4295 | | |
|---|
| 4296 | | #error "This is not a C++11 compiler" |
|---|
| 4297 | | |
|---|
| 4298 | | #else |
|---|
| 4299 | | |
|---|
| 4300 | | namespace cxx11 |
|---|
| 4301 | | { |
|---|
| 4302 | | |
|---|
| 4303 | | namespace test_static_assert |
|---|
| 4304 | | { |
|---|
| 4305 | | |
|---|
| 4306 | | template <typename T> |
|---|
| 4307 | | struct check |
|---|
| 4308 | | { |
|---|
| 4309 | | static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
|---|
| 4310 | | }; |
|---|
| 4311 | | |
|---|
| 4312 | | } |
|---|
| 4313 | | |
|---|
| 4314 | | namespace test_final_override |
|---|
| 4315 | | { |
|---|
| 4316 | | |
|---|
| 4317 | | struct Base |
|---|
| 4318 | | { |
|---|
| 4319 | | virtual ~Base() {} |
|---|
| 4320 | | virtual void f() {} |
|---|
| 4321 | | }; |
|---|
| 4322 | | |
|---|
| 4323 | | struct Derived : public Base |
|---|
| 4324 | | { |
|---|
| 4325 | | virtual ~Derived() override {} |
|---|
| 4326 | | virtual void f() override {} |
|---|
| 4327 | | }; |
|---|
| 4328 | | |
|---|
| 4329 | | } |
|---|
| 4330 | | |
|---|
| 4331 | | namespace test_double_right_angle_brackets |
|---|
| 4332 | | { |
|---|
| 4333 | | |
|---|
| 4334 | | template < typename T > |
|---|
| 4335 | | struct check {}; |
|---|
| 4336 | | |
|---|
| 4337 | | typedef check<void> single_type; |
|---|
| 4338 | | typedef check<check<void>> double_type; |
|---|
| 4339 | | typedef check<check<check<void>>> triple_type; |
|---|
| 4340 | | typedef check<check<check<check<void>>>> quadruple_type; |
|---|
| 4341 | | |
|---|
| 4342 | | } |
|---|
| 4343 | | |
|---|
| 4344 | | namespace test_decltype |
|---|
| 4345 | | { |
|---|
| 4346 | | |
|---|
| 4347 | | int |
|---|
| 4348 | | f() |
|---|
| 4349 | | { |
|---|
| 4350 | | int a = 1; |
|---|
| 4351 | | decltype(a) b = 2; |
|---|
| 4352 | | return a + b; |
|---|
| 4353 | | } |
|---|
| 4354 | | |
|---|
| 4355 | | } |
|---|
| 4356 | | |
|---|
| 4357 | | namespace test_type_deduction |
|---|
| 4358 | | { |
|---|
| 4359 | | |
|---|
| 4360 | | template < typename T1, typename T2 > |
|---|
| 4361 | | struct is_same |
|---|
| 4362 | | { |
|---|
| 4363 | | static const bool value = false; |
|---|
| 4364 | | }; |
|---|
| 4365 | | |
|---|
| 4366 | | template < typename T > |
|---|
| 4367 | | struct is_same<T, T> |
|---|
| 4368 | | { |
|---|
| 4369 | | static const bool value = true; |
|---|
| 4370 | | }; |
|---|
| 4371 | | |
|---|
| 4372 | | template < typename T1, typename T2 > |
|---|
| 4373 | | auto |
|---|
| 4374 | | add(T1 a1, T2 a2) -> decltype(a1 + a2) |
|---|
| 4375 | | { |
|---|
| 4376 | | return a1 + a2; |
|---|
| 4377 | | } |
|---|
| 4378 | | |
|---|
| 4379 | | int |
|---|
| 4380 | | test(const int c, volatile int v) |
|---|
| 4381 | | { |
|---|
| 4382 | | static_assert(is_same<int, decltype(0)>::value == true, ""); |
|---|
| 4383 | | static_assert(is_same<int, decltype(c)>::value == false, ""); |
|---|
| 4384 | | static_assert(is_same<int, decltype(v)>::value == false, ""); |
|---|
| 4385 | | auto ac = c; |
|---|
| 4386 | | auto av = v; |
|---|
| 4387 | | auto sumi = ac + av + 'x'; |
|---|
| 4388 | | auto sumf = ac + av + 1.0; |
|---|
| 4389 | | static_assert(is_same<int, decltype(ac)>::value == true, ""); |
|---|
| 4390 | | static_assert(is_same<int, decltype(av)>::value == true, ""); |
|---|
| 4391 | | static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
|---|
| 4392 | | static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
|---|
| 4393 | | static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
|---|
| 4394 | | return (sumf > 0.0) ? sumi : add(c, v); |
|---|
| 4395 | | } |
|---|
| 4396 | | |
|---|
| 4397 | | } |
|---|
| 4398 | | |
|---|
| 4399 | | namespace test_noexcept |
|---|
| 4400 | | { |
|---|
| 4401 | | |
|---|
| 4402 | | int f() { return 0; } |
|---|
| 4403 | | int g() noexcept { return 0; } |
|---|
| 4404 | | |
|---|
| 4405 | | static_assert(noexcept(f()) == false, ""); |
|---|
| 4406 | | static_assert(noexcept(g()) == true, ""); |
|---|
| 4407 | | |
|---|
| 4408 | | } |
|---|
| 4409 | | |
|---|
| 4410 | | namespace test_constexpr |
|---|
| 4411 | | { |
|---|
| 4412 | | |
|---|
| 4413 | | template < typename CharT > |
|---|
| 4414 | | unsigned long constexpr |
|---|
| 4415 | | strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
|---|
| 4416 | | { |
|---|
| 4417 | | return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
|---|
| 4418 | | } |
|---|
| 4419 | | |
|---|
| 4420 | | template < typename CharT > |
|---|
| 4421 | | unsigned long constexpr |
|---|
| 4422 | | strlen_c(const CharT *const s) noexcept |
|---|
| 4423 | | { |
|---|
| 4424 | | return strlen_c_r(s, 0UL); |
|---|
| 4425 | | } |
|---|
| 4426 | | |
|---|
| 4427 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 4428 | | static_assert(strlen_c("1") == 1UL, ""); |
|---|
| 4429 | | static_assert(strlen_c("example") == 7UL, ""); |
|---|
| 4430 | | static_assert(strlen_c("another\0example") == 7UL, ""); |
|---|
| 4431 | | |
|---|
| 4432 | | } |
|---|
| 4433 | | |
|---|
| 4434 | | namespace test_rvalue_references |
|---|
| 4435 | | { |
|---|
| 4436 | | |
|---|
| 4437 | | template < int N > |
|---|
| 4438 | | struct answer |
|---|
| 4439 | | { |
|---|
| 4440 | | static constexpr int value = N; |
|---|
| 4441 | | }; |
|---|
| 4442 | | |
|---|
| 4443 | | answer<1> f(int&) { return answer<1>(); } |
|---|
| 4444 | | answer<2> f(const int&) { return answer<2>(); } |
|---|
| 4445 | | answer<3> f(int&&) { return answer<3>(); } |
|---|
| 4446 | | |
|---|
| 4447 | | void |
|---|
| 4448 | | test() |
|---|
| 4449 | | { |
|---|
| 4450 | | int i = 0; |
|---|
| 4451 | | const int c = 0; |
|---|
| 4452 | | static_assert(decltype(f(i))::value == 1, ""); |
|---|
| 4453 | | static_assert(decltype(f(c))::value == 2, ""); |
|---|
| 4454 | | static_assert(decltype(f(0))::value == 3, ""); |
|---|
| 4455 | | } |
|---|
| 4456 | | |
|---|
| 4457 | | } |
|---|
| 4458 | | |
|---|
| 4459 | | namespace test_uniform_initialization |
|---|
| 4460 | | { |
|---|
| 4461 | | |
|---|
| 4462 | | struct test |
|---|
| 4463 | | { |
|---|
| 4464 | | static const int zero {}; |
|---|
| 4465 | | static const int one {1}; |
|---|
| 4466 | | }; |
|---|
| 4467 | | |
|---|
| 4468 | | static_assert(test::zero == 0, ""); |
|---|
| 4469 | | static_assert(test::one == 1, ""); |
|---|
| 4470 | | |
|---|
| 4471 | | } |
|---|
| 4472 | | |
|---|
| 4473 | | namespace test_lambdas |
|---|
| 4474 | | { |
|---|
| 4475 | | |
|---|
| 4476 | | void |
|---|
| 4477 | | test1() |
|---|
| 4478 | | { |
|---|
| 4479 | | auto lambda1 = [](){}; |
|---|
| 4480 | | auto lambda2 = lambda1; |
|---|
| 4481 | | lambda1(); |
|---|
| 4482 | | lambda2(); |
|---|
| 4483 | | } |
|---|
| 4484 | | |
|---|
| 4485 | | int |
|---|
| 4486 | | test2() |
|---|
| 4487 | | { |
|---|
| 4488 | | auto a = [](int i, int j){ return i + j; }(1, 2); |
|---|
| 4489 | | auto b = []() -> int { return '0'; }(); |
|---|
| 4490 | | auto c = [=](){ return a + b; }(); |
|---|
| 4491 | | auto d = [&](){ return c; }(); |
|---|
| 4492 | | auto e = [a, &b](int x) mutable { |
|---|
| 4493 | | const auto identity = [](int y){ return y; }; |
|---|
| 4494 | | for (auto i = 0; i < a; ++i) |
|---|
| 4495 | | a += b--; |
|---|
| 4496 | | return x + identity(a + b); |
|---|
| 4497 | | }(0); |
|---|
| 4498 | | return a + b + c + d + e; |
|---|
| 4499 | | } |
|---|
| 4500 | | |
|---|
| 4501 | | int |
|---|
| 4502 | | test3() |
|---|
| 4503 | | { |
|---|
| 4504 | | const auto nullary = [](){ return 0; }; |
|---|
| 4505 | | const auto unary = [](int x){ return x; }; |
|---|
| 4506 | | using nullary_t = decltype(nullary); |
|---|
| 4507 | | using unary_t = decltype(unary); |
|---|
| 4508 | | const auto higher1st = [](nullary_t f){ return f(); }; |
|---|
| 4509 | | const auto higher2nd = [unary](nullary_t f1){ |
|---|
| 4510 | | return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
|---|
| 4511 | | }; |
|---|
| 4512 | | return higher1st(nullary) + higher2nd(nullary)(unary); |
|---|
| 4513 | | } |
|---|
| 4514 | | |
|---|
| 4515 | | } |
|---|
| 4516 | | |
|---|
| 4517 | | namespace test_variadic_templates |
|---|
| 4518 | | { |
|---|
| 4519 | | |
|---|
| 4520 | | template <int...> |
|---|
| 4521 | | struct sum; |
|---|
| 4522 | | |
|---|
| 4523 | | template <int N0, int... N1toN> |
|---|
| 4524 | | struct sum<N0, N1toN...> |
|---|
| 4525 | | { |
|---|
| 4526 | | static constexpr auto value = N0 + sum<N1toN...>::value; |
|---|
| 4527 | | }; |
|---|
| 4528 | | |
|---|
| 4529 | | template <> |
|---|
| 4530 | | struct sum<> |
|---|
| 4531 | | { |
|---|
| 4532 | | static constexpr auto value = 0; |
|---|
| 4533 | | }; |
|---|
| 4534 | | |
|---|
| 4535 | | static_assert(sum<>::value == 0, ""); |
|---|
| 4536 | | static_assert(sum<1>::value == 1, ""); |
|---|
| 4537 | | static_assert(sum<23>::value == 23, ""); |
|---|
| 4538 | | static_assert(sum<1, 2>::value == 3, ""); |
|---|
| 4539 | | static_assert(sum<5, 5, 11>::value == 21, ""); |
|---|
| 4540 | | static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
|---|
| 4541 | | |
|---|
| 4542 | | } |
|---|
| 4543 | | |
|---|
| 4544 | | // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
|---|
| 4545 | | // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
|---|
| 4546 | | // because of this. |
|---|
| 4547 | | namespace test_template_alias_sfinae |
|---|
| 4548 | | { |
|---|
| 4549 | | |
|---|
| 4550 | | struct foo {}; |
|---|
| 4551 | | |
|---|
| 4552 | | template<typename T> |
|---|
| 4553 | | using member = typename T::member_type; |
|---|
| 4554 | | |
|---|
| 4555 | | template<typename T> |
|---|
| 4556 | | void func(...) {} |
|---|
| 4557 | | |
|---|
| 4558 | | template<typename T> |
|---|
| 4559 | | void func(member<T>*) {} |
|---|
| 4560 | | |
|---|
| 4561 | | void test(); |
|---|
| 4562 | | |
|---|
| 4563 | | void test() { func<foo>(0); } |
|---|
| 4564 | | |
|---|
| 4565 | | } |
|---|
| 4566 | | |
|---|
| 4567 | | } // namespace cxx11 |
|---|
| 4568 | | |
|---|
| 4569 | | #endif // __cplusplus >= 201103L |
|---|
| 4570 | | |
|---|
| 4571 | | |
|---|
| 4572 | | |
|---|
| 4573 | | |
|---|
| 4574 | | // If the compiler admits that it is not ready for C++14, why torture it? |
|---|
| 4575 | | // Hopefully, this will speed up the test. |
|---|
| 4576 | | |
|---|
| 4577 | | #ifndef __cplusplus |
|---|
| 4578 | | |
|---|
| 4579 | | #error "This is not a C++ compiler" |
|---|
| 4580 | | |
|---|
| 4581 | | #elif __cplusplus < 201402L |
|---|
| 4582 | | |
|---|
| 4583 | | #error "This is not a C++14 compiler" |
|---|
| 4584 | | |
|---|
| 4585 | | #else |
|---|
| 4586 | | |
|---|
| 4587 | | namespace cxx14 |
|---|
| 4588 | | { |
|---|
| 4589 | | |
|---|
| 4590 | | namespace test_polymorphic_lambdas |
|---|
| 4591 | | { |
|---|
| 4592 | | |
|---|
| 4593 | | int |
|---|
| 4594 | | test() |
|---|
| 4595 | | { |
|---|
| 4596 | | const auto lambda = [](auto&&... args){ |
|---|
| 4597 | | const auto istiny = [](auto x){ |
|---|
| 4598 | | return (sizeof(x) == 1UL) ? 1 : 0; |
|---|
| 4599 | | }; |
|---|
| 4600 | | const int aretiny[] = { istiny(args)... }; |
|---|
| 4601 | | return aretiny[0]; |
|---|
| 4602 | | }; |
|---|
| 4603 | | return lambda(1, 1L, 1.0f, '1'); |
|---|
| 4604 | | } |
|---|
| 4605 | | |
|---|
| 4606 | | } |
|---|
| 4607 | | |
|---|
| 4608 | | namespace test_binary_literals |
|---|
| 4609 | | { |
|---|
| 4610 | | |
|---|
| 4611 | | constexpr auto ivii = 0b0000000000101010; |
|---|
| 4612 | | static_assert(ivii == 42, "wrong value"); |
|---|
| 4613 | | |
|---|
| 4614 | | } |
|---|
| 4615 | | |
|---|
| 4616 | | namespace test_generalized_constexpr |
|---|
| 4617 | | { |
|---|
| 4618 | | |
|---|
| 4619 | | template < typename CharT > |
|---|
| 4620 | | constexpr unsigned long |
|---|
| 4621 | | strlen_c(const CharT *const s) noexcept |
|---|
| 4622 | | { |
|---|
| 4623 | | auto length = 0UL; |
|---|
| 4624 | | for (auto p = s; *p; ++p) |
|---|
| 4625 | | ++length; |
|---|
| 4626 | | return length; |
|---|
| 4627 | | } |
|---|
| 4628 | | |
|---|
| 4629 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 4630 | | static_assert(strlen_c("x") == 1UL, ""); |
|---|
| 4631 | | static_assert(strlen_c("test") == 4UL, ""); |
|---|
| 4632 | | static_assert(strlen_c("another\0test") == 7UL, ""); |
|---|
| 4633 | | |
|---|
| 4634 | | } |
|---|
| 4635 | | |
|---|
| 4636 | | namespace test_lambda_init_capture |
|---|
| 4637 | | { |
|---|
| 4638 | | |
|---|
| 4639 | | int |
|---|
| 4640 | | test() |
|---|
| 4641 | | { |
|---|
| 4642 | | auto x = 0; |
|---|
| 4643 | | const auto lambda1 = [a = x](int b){ return a + b; }; |
|---|
| 4644 | | const auto lambda2 = [a = lambda1(x)](){ return a; }; |
|---|
| 4645 | | return lambda2(); |
|---|
| 4646 | | } |
|---|
| 4647 | | |
|---|
| 4648 | | } |
|---|
| 4649 | | |
|---|
| 4650 | | namespace test_digit_separators |
|---|
| 4651 | | { |
|---|
| 4652 | | |
|---|
| 4653 | | constexpr auto ten_million = 100'000'000; |
|---|
| 4654 | | static_assert(ten_million == 100000000, ""); |
|---|
| 4655 | | |
|---|
| 4656 | | } |
|---|
| 4657 | | |
|---|
| 4658 | | namespace test_return_type_deduction |
|---|
| 4659 | | { |
|---|
| 4660 | | |
|---|
| 4661 | | auto f(int& x) { return x; } |
|---|
| 4662 | | decltype(auto) g(int& x) { return x; } |
|---|
| 4663 | | |
|---|
| 4664 | | template < typename T1, typename T2 > |
|---|
| 4665 | | struct is_same |
|---|
| 4666 | | { |
|---|
| 4667 | | static constexpr auto value = false; |
|---|
| 4668 | | }; |
|---|
| 4669 | | |
|---|
| 4670 | | template < typename T > |
|---|
| 4671 | | struct is_same<T, T> |
|---|
| 4672 | | { |
|---|
| 4673 | | static constexpr auto value = true; |
|---|
| 4674 | | }; |
|---|
| 4675 | | |
|---|
| 4676 | | int |
|---|
| 4677 | | test() |
|---|
| 4678 | | { |
|---|
| 4679 | | auto x = 0; |
|---|
| 4680 | | static_assert(is_same<int, decltype(f(x))>::value, ""); |
|---|
| 4681 | | static_assert(is_same<int&, decltype(g(x))>::value, ""); |
|---|
| 4682 | | return x; |
|---|
| 4683 | | } |
|---|
| 4684 | | |
|---|
| 4685 | | } |
|---|
| 4686 | | |
|---|
| 4687 | | } // namespace cxx14 |
|---|
| 4688 | | |
|---|
| 4689 | | #endif // __cplusplus >= 201402L |
|---|
| 4690 | | |
|---|
| 4691 | | |
|---|
| 4692 | | |
|---|
| 4693 | | |
|---|
| 4694 | | // If the compiler admits that it is not ready for C++17, why torture it? |
|---|
| 4695 | | // Hopefully, this will speed up the test. |
|---|
| 4696 | | |
|---|
| 4697 | | #ifndef __cplusplus |
|---|
| 4698 | | |
|---|
| 4699 | | #error "This is not a C++ compiler" |
|---|
| 4700 | | |
|---|
| 4701 | | #elif __cplusplus < 201703L |
|---|
| 4702 | | |
|---|
| 4703 | | #error "This is not a C++17 compiler" |
|---|
| 4704 | | |
|---|
| 4705 | | #else |
|---|
| 4706 | | |
|---|
| 4707 | | #include <initializer_list> |
|---|
| 4708 | | #include <utility> |
|---|
| 4709 | | #include <type_traits> |
|---|
| 4710 | | |
|---|
| 4711 | | namespace cxx17 |
|---|
| 4712 | | { |
|---|
| 4713 | | |
|---|
| 4714 | | namespace test_constexpr_lambdas |
|---|
| 4715 | | { |
|---|
| 4716 | | |
|---|
| 4717 | | constexpr int foo = [](){return 42;}(); |
|---|
| 4718 | | |
|---|
| 4719 | | } |
|---|
| 4720 | | |
|---|
| 4721 | | namespace test::nested_namespace::definitions |
|---|
| 4722 | | { |
|---|
| 4723 | | |
|---|
| 4724 | | } |
|---|
| 4725 | | |
|---|
| 4726 | | namespace test_fold_expression |
|---|
| 4727 | | { |
|---|
| 4728 | | |
|---|
| 4729 | | template<typename... Args> |
|---|
| 4730 | | int multiply(Args... args) |
|---|
| 4731 | | { |
|---|
| 4732 | | return (args * ... * 1); |
|---|
| 4733 | | } |
|---|
| 4734 | | |
|---|
| 4735 | | template<typename... Args> |
|---|
| 4736 | | bool all(Args... args) |
|---|
| 4737 | | { |
|---|
| 4738 | | return (args && ...); |
|---|
| 4739 | | } |
|---|
| 4740 | | |
|---|
| 4741 | | } |
|---|
| 4742 | | |
|---|
| 4743 | | namespace test_extended_static_assert |
|---|
| 4744 | | { |
|---|
| 4745 | | |
|---|
| 4746 | | static_assert (true); |
|---|
| 4747 | | |
|---|
| 4748 | | } |
|---|
| 4749 | | |
|---|
| 4750 | | namespace test_auto_brace_init_list |
|---|
| 4751 | | { |
|---|
| 4752 | | |
|---|
| 4753 | | auto foo = {5}; |
|---|
| 4754 | | auto bar {5}; |
|---|
| 4755 | | |
|---|
| 4756 | | static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
|---|
| 4757 | | static_assert(std::is_same<int, decltype(bar)>::value); |
|---|
| 4758 | | } |
|---|
| 4759 | | |
|---|
| 4760 | | namespace test_typename_in_template_template_parameter |
|---|
| 4761 | | { |
|---|
| 4762 | | |
|---|
| 4763 | | template<template<typename> typename X> struct D; |
|---|
| 4764 | | |
|---|
| 4765 | | } |
|---|
| 4766 | | |
|---|
| 4767 | | namespace test_fallthrough_nodiscard_maybe_unused_attributes |
|---|
| 4768 | | { |
|---|
| 4769 | | |
|---|
| 4770 | | int f1() |
|---|
| 4771 | | { |
|---|
| 4772 | | return 42; |
|---|
| 4773 | | } |
|---|
| 4774 | | |
|---|
| 4775 | | [[nodiscard]] int f2() |
|---|
| 4776 | | { |
|---|
| 4777 | | [[maybe_unused]] auto unused = f1(); |
|---|
| 4778 | | |
|---|
| 4779 | | switch (f1()) |
|---|
| 4780 | | { |
|---|
| 4781 | | case 17: |
|---|
| 4782 | | f1(); |
|---|
| 4783 | | [[fallthrough]]; |
|---|
| 4784 | | case 42: |
|---|
| 4785 | | f1(); |
|---|
| 4786 | | } |
|---|
| 4787 | | return f1(); |
|---|
| 4788 | | } |
|---|
| 4789 | | |
|---|
| 4790 | | } |
|---|
| 4791 | | |
|---|
| 4792 | | namespace test_extended_aggregate_initialization |
|---|
| 4793 | | { |
|---|
| 4794 | | |
|---|
| 4795 | | struct base1 |
|---|
| 4796 | | { |
|---|
| 4797 | | int b1, b2 = 42; |
|---|
| 4798 | | }; |
|---|
| 4799 | | |
|---|
| 4800 | | struct base2 |
|---|
| 4801 | | { |
|---|
| 4802 | | base2() { |
|---|
| 4803 | | b3 = 42; |
|---|
| 4804 | | } |
|---|
| 4805 | | int b3; |
|---|
| 4806 | | }; |
|---|
| 4807 | | |
|---|
| 4808 | | struct derived : base1, base2 |
|---|
| 4809 | | { |
|---|
| 4810 | | int d; |
|---|
| 4811 | | }; |
|---|
| 4812 | | |
|---|
| 4813 | | derived d1 {{1, 2}, {}, 4}; // full initialization |
|---|
| 4814 | | derived d2 {{}, {}, 4}; // value-initialized bases |
|---|
| 4815 | | |
|---|
| 4816 | | } |
|---|
| 4817 | | |
|---|
| 4818 | | namespace test_general_range_based_for_loop |
|---|
| 4819 | | { |
|---|
| 4820 | | |
|---|
| 4821 | | struct iter |
|---|
| 4822 | | { |
|---|
| 4823 | | int i; |
|---|
| 4824 | | |
|---|
| 4825 | | int& operator* () |
|---|
| 4826 | | { |
|---|
| 4827 | | return i; |
|---|
| 4828 | | } |
|---|
| 4829 | | |
|---|
| 4830 | | const int& operator* () const |
|---|
| 4831 | | { |
|---|
| 4832 | | return i; |
|---|
| 4833 | | } |
|---|
| 4834 | | |
|---|
| 4835 | | iter& operator++() |
|---|
| 4836 | | { |
|---|
| 4837 | | ++i; |
|---|
| 4838 | | return *this; |
|---|
| 4839 | | } |
|---|
| 4840 | | }; |
|---|
| 4841 | | |
|---|
| 4842 | | struct sentinel |
|---|
| 4843 | | { |
|---|
| 4844 | | int i; |
|---|
| 4845 | | }; |
|---|
| 4846 | | |
|---|
| 4847 | | bool operator== (const iter& i, const sentinel& s) |
|---|
| 4848 | | { |
|---|
| 4849 | | return i.i == s.i; |
|---|
| 4850 | | } |
|---|
| 4851 | | |
|---|
| 4852 | | bool operator!= (const iter& i, const sentinel& s) |
|---|
| 4853 | | { |
|---|
| 4854 | | return !(i == s); |
|---|
| 4855 | | } |
|---|
| 4856 | | |
|---|
| 4857 | | struct range |
|---|
| 4858 | | { |
|---|
| 4859 | | iter begin() const |
|---|
| 4860 | | { |
|---|
| 4861 | | return {0}; |
|---|
| 4862 | | } |
|---|
| 4863 | | |
|---|
| 4864 | | sentinel end() const |
|---|
| 4865 | | { |
|---|
| 4866 | | return {5}; |
|---|
| 4867 | | } |
|---|
| 4868 | | }; |
|---|
| 4869 | | |
|---|
| 4870 | | void f() |
|---|
| 4871 | | { |
|---|
| 4872 | | range r {}; |
|---|
| 4873 | | |
|---|
| 4874 | | for (auto i : r) |
|---|
| 4875 | | { |
|---|
| 4876 | | [[maybe_unused]] auto v = i; |
|---|
| 4877 | | } |
|---|
| 4878 | | } |
|---|
| 4879 | | |
|---|
| 4880 | | } |
|---|
| 4881 | | |
|---|
| 4882 | | namespace test_lambda_capture_asterisk_this_by_value |
|---|
| 4883 | | { |
|---|
| 4884 | | |
|---|
| 4885 | | struct t |
|---|
| 4886 | | { |
|---|
| 4887 | | int i; |
|---|
| 4888 | | int foo() |
|---|
| 4889 | | { |
|---|
| 4890 | | return [*this]() |
|---|
| 4891 | | { |
|---|
| 4892 | | return i; |
|---|
| 4893 | | }(); |
|---|
| 4894 | | } |
|---|
| 4895 | | }; |
|---|
| 4896 | | |
|---|
| 4897 | | } |
|---|
| 4898 | | |
|---|
| 4899 | | namespace test_enum_class_construction |
|---|
| 4900 | | { |
|---|
| 4901 | | |
|---|
| 4902 | | enum class byte : unsigned char |
|---|
| 4903 | | {}; |
|---|
| 4904 | | |
|---|
| 4905 | | byte foo {42}; |
|---|
| 4906 | | |
|---|
| 4907 | | } |
|---|
| 4908 | | |
|---|
| 4909 | | namespace test_constexpr_if |
|---|
| 4910 | | { |
|---|
| 4911 | | |
|---|
| 4912 | | template <bool cond> |
|---|
| 4913 | | int f () |
|---|
| 4914 | | { |
|---|
| 4915 | | if constexpr(cond) |
|---|
| 4916 | | { |
|---|
| 4917 | | return 13; |
|---|
| 4918 | | } |
|---|
| 4919 | | else |
|---|
| 4920 | | { |
|---|
| 4921 | | return 42; |
|---|
| 4922 | | } |
|---|
| 4923 | | } |
|---|
| 4924 | | |
|---|
| 4925 | | } |
|---|
| 4926 | | |
|---|
| 4927 | | namespace test_selection_statement_with_initializer |
|---|
| 4928 | | { |
|---|
| 4929 | | |
|---|
| 4930 | | int f() |
|---|
| 4931 | | { |
|---|
| 4932 | | return 13; |
|---|
| 4933 | | } |
|---|
| 4934 | | |
|---|
| 4935 | | int f2() |
|---|
| 4936 | | { |
|---|
| 4937 | | if (auto i = f(); i > 0) |
|---|
| 4938 | | { |
|---|
| 4939 | | return 3; |
|---|
| 4940 | | } |
|---|
| 4941 | | |
|---|
| 4942 | | switch (auto i = f(); i + 4) |
|---|
| 4943 | | { |
|---|
| 4944 | | case 17: |
|---|
| 4945 | | return 2; |
|---|
| 4946 | | |
|---|
| 4947 | | default: |
|---|
| 4948 | | return 1; |
|---|
| 4949 | | } |
|---|
| 4950 | | } |
|---|
| 4951 | | |
|---|
| 4952 | | } |
|---|
| 4953 | | |
|---|
| 4954 | | namespace test_template_argument_deduction_for_class_templates |
|---|
| 4955 | | { |
|---|
| 4956 | | |
|---|
| 4957 | | template <typename T1, typename T2> |
|---|
| 4958 | | struct pair |
|---|
| 4959 | | { |
|---|
| 4960 | | pair (T1 p1, T2 p2) |
|---|
| 4961 | | : m1 {p1}, |
|---|
| 4962 | | m2 {p2} |
|---|
| 4963 | | {} |
|---|
| 4964 | | |
|---|
| 4965 | | T1 m1; |
|---|
| 4966 | | T2 m2; |
|---|
| 4967 | | }; |
|---|
| 4968 | | |
|---|
| 4969 | | void f() |
|---|
| 4970 | | { |
|---|
| 4971 | | [[maybe_unused]] auto p = pair{13, 42u}; |
|---|
| 4972 | | } |
|---|
| 4973 | | |
|---|
| 4974 | | } |
|---|
| 4975 | | |
|---|
| 4976 | | namespace test_non_type_auto_template_parameters |
|---|
| 4977 | | { |
|---|
| 4978 | | |
|---|
| 4979 | | template <auto n> |
|---|
| 4980 | | struct B |
|---|
| 4981 | | {}; |
|---|
| 4982 | | |
|---|
| 4983 | | B<5> b1; |
|---|
| 4984 | | B<'a'> b2; |
|---|
| 4985 | | |
|---|
| 4986 | | } |
|---|
| 4987 | | |
|---|
| 4988 | | namespace test_structured_bindings |
|---|
| 4989 | | { |
|---|
| 4990 | | |
|---|
| 4991 | | int arr[2] = { 1, 2 }; |
|---|
| 4992 | | std::pair<int, int> pr = { 1, 2 }; |
|---|
| 4993 | | |
|---|
| 4994 | | auto f1() -> int(&)[2] |
|---|
| 4995 | | { |
|---|
| 4996 | | return arr; |
|---|
| 4997 | | } |
|---|
| 4998 | | |
|---|
| 4999 | | auto f2() -> std::pair<int, int>& |
|---|
| 5000 | | { |
|---|
| 5001 | | return pr; |
|---|
| 5002 | | } |
|---|
| 5003 | | |
|---|
| 5004 | | struct S |
|---|
| 5005 | | { |
|---|
| 5006 | | int x1 : 2; |
|---|
| 5007 | | volatile double y1; |
|---|
| 5008 | | }; |
|---|
| 5009 | | |
|---|
| 5010 | | S f3() |
|---|
| 5011 | | { |
|---|
| 5012 | | return {}; |
|---|
| 5013 | | } |
|---|
| 5014 | | |
|---|
| 5015 | | auto [ x1, y1 ] = f1(); |
|---|
| 5016 | | auto& [ xr1, yr1 ] = f1(); |
|---|
| 5017 | | auto [ x2, y2 ] = f2(); |
|---|
| 5018 | | auto& [ xr2, yr2 ] = f2(); |
|---|
| 5019 | | const auto [ x3, y3 ] = f3(); |
|---|
| 5020 | | |
|---|
| 5021 | | } |
|---|
| 5022 | | |
|---|
| 5023 | | namespace test_exception_spec_type_system |
|---|
| 5024 | | { |
|---|
| 5025 | | |
|---|
| 5026 | | struct Good {}; |
|---|
| 5027 | | struct Bad {}; |
|---|
| 5028 | | |
|---|
| 5029 | | void g1() noexcept; |
|---|
| 5030 | | void g2(); |
|---|
| 5031 | | |
|---|
| 5032 | | template<typename T> |
|---|
| 5033 | | Bad |
|---|
| 5034 | | f(T*, T*); |
|---|
| 5035 | | |
|---|
| 5036 | | template<typename T1, typename T2> |
|---|
| 5037 | | Good |
|---|
| 5038 | | f(T1*, T2*); |
|---|
| 5039 | | |
|---|
| 5040 | | static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
|---|
| 5041 | | |
|---|
| 5042 | | } |
|---|
| 5043 | | |
|---|
| 5044 | | namespace test_inline_variables |
|---|
| 5045 | | { |
|---|
| 5046 | | |
|---|
| 5047 | | template<class T> void f(T) |
|---|
| 5048 | | {} |
|---|
| 5049 | | |
|---|
| 5050 | | template<class T> inline T g(T) |
|---|
| 5051 | | { |
|---|
| 5052 | | return T{}; |
|---|
| 5053 | | } |
|---|
| 5054 | | |
|---|
| 5055 | | template<> inline void f<>(int) |
|---|
| 5056 | | {} |
|---|
| 5057 | | |
|---|
| 5058 | | template<> int g<>(int) |
|---|
| 5059 | | { |
|---|
| 5060 | | return 5; |
|---|
| 5061 | | } |
|---|
| 5062 | | |
|---|
| 5063 | | } |
|---|
| 5064 | | |
|---|
| 5065 | | } // namespace cxx17 |
|---|
| 5066 | | |
|---|
| 5067 | | #endif // __cplusplus < 201703L |
|---|
| 5068 | | |
|---|
| 5069 | | |
|---|
| 5070 | | |
|---|
| 5071 | configure:21015: result: no |
|---|
| 5072 | configure:20206: checking whether /usr/bin/clang++ supports C++17 features with -std=c++1z |
|---|
| 5073 | configure:21003: /usr/bin/clang++ -std=c++1z -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 5074 | conftest.cpp:450:10: fatal error: 'initializer_list' file not found |
|---|
| 5075 | 450 | #include <initializer_list> |
|---|
| 5076 | | ^~~~~~~~~~~~~~~~~~ |
|---|
| 5077 | 1 error generated. |
|---|
| 5078 | configure:21003: $? = 1 |
|---|
| 5079 | configure: failed program was: |
|---|
| 5080 | | /* confdefs.h */ |
|---|
| 5081 | | #define PACKAGE_NAME "graphviz" |
|---|
| 5082 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 5083 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 5084 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 5085 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 5086 | | #define PACKAGE_URL "" |
|---|
| 5087 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 5088 | | #define GVPLUGIN_VERSION 6 |
|---|
| 5089 | | #define DARWIN 1 |
|---|
| 5090 | | #define DARWIN_DYLIB "" |
|---|
| 5091 | | #define DEFAULT_DPI 96 |
|---|
| 5092 | | #define BROWSER "open" |
|---|
| 5093 | | #define YYTEXT_POINTER 1 |
|---|
| 5094 | | #define HAVE_STDIO_H 1 |
|---|
| 5095 | | #define HAVE_STDLIB_H 1 |
|---|
| 5096 | | #define HAVE_STRING_H 1 |
|---|
| 5097 | | #define HAVE_INTTYPES_H 1 |
|---|
| 5098 | | #define HAVE_STDINT_H 1 |
|---|
| 5099 | | #define HAVE_STRINGS_H 1 |
|---|
| 5100 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 5101 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 5102 | | #define HAVE_UNISTD_H 1 |
|---|
| 5103 | | #define STDC_HEADERS 1 |
|---|
| 5104 | | #define HAVE_DLFCN_H 1 |
|---|
| 5105 | | #define LT_OBJDIR ".libs/" |
|---|
| 5106 | | /* end confdefs.h. */ |
|---|
| 5107 | | |
|---|
| 5108 | | |
|---|
| 5109 | | // If the compiler admits that it is not ready for C++11, why torture it? |
|---|
| 5110 | | // Hopefully, this will speed up the test. |
|---|
| 5111 | | |
|---|
| 5112 | | #ifndef __cplusplus |
|---|
| 5113 | | |
|---|
| 5114 | | #error "This is not a C++ compiler" |
|---|
| 5115 | | |
|---|
| 5116 | | #elif __cplusplus < 201103L |
|---|
| 5117 | | |
|---|
| 5118 | | #error "This is not a C++11 compiler" |
|---|
| 5119 | | |
|---|
| 5120 | | #else |
|---|
| 5121 | | |
|---|
| 5122 | | namespace cxx11 |
|---|
| 5123 | | { |
|---|
| 5124 | | |
|---|
| 5125 | | namespace test_static_assert |
|---|
| 5126 | | { |
|---|
| 5127 | | |
|---|
| 5128 | | template <typename T> |
|---|
| 5129 | | struct check |
|---|
| 5130 | | { |
|---|
| 5131 | | static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
|---|
| 5132 | | }; |
|---|
| 5133 | | |
|---|
| 5134 | | } |
|---|
| 5135 | | |
|---|
| 5136 | | namespace test_final_override |
|---|
| 5137 | | { |
|---|
| 5138 | | |
|---|
| 5139 | | struct Base |
|---|
| 5140 | | { |
|---|
| 5141 | | virtual ~Base() {} |
|---|
| 5142 | | virtual void f() {} |
|---|
| 5143 | | }; |
|---|
| 5144 | | |
|---|
| 5145 | | struct Derived : public Base |
|---|
| 5146 | | { |
|---|
| 5147 | | virtual ~Derived() override {} |
|---|
| 5148 | | virtual void f() override {} |
|---|
| 5149 | | }; |
|---|
| 5150 | | |
|---|
| 5151 | | } |
|---|
| 5152 | | |
|---|
| 5153 | | namespace test_double_right_angle_brackets |
|---|
| 5154 | | { |
|---|
| 5155 | | |
|---|
| 5156 | | template < typename T > |
|---|
| 5157 | | struct check {}; |
|---|
| 5158 | | |
|---|
| 5159 | | typedef check<void> single_type; |
|---|
| 5160 | | typedef check<check<void>> double_type; |
|---|
| 5161 | | typedef check<check<check<void>>> triple_type; |
|---|
| 5162 | | typedef check<check<check<check<void>>>> quadruple_type; |
|---|
| 5163 | | |
|---|
| 5164 | | } |
|---|
| 5165 | | |
|---|
| 5166 | | namespace test_decltype |
|---|
| 5167 | | { |
|---|
| 5168 | | |
|---|
| 5169 | | int |
|---|
| 5170 | | f() |
|---|
| 5171 | | { |
|---|
| 5172 | | int a = 1; |
|---|
| 5173 | | decltype(a) b = 2; |
|---|
| 5174 | | return a + b; |
|---|
| 5175 | | } |
|---|
| 5176 | | |
|---|
| 5177 | | } |
|---|
| 5178 | | |
|---|
| 5179 | | namespace test_type_deduction |
|---|
| 5180 | | { |
|---|
| 5181 | | |
|---|
| 5182 | | template < typename T1, typename T2 > |
|---|
| 5183 | | struct is_same |
|---|
| 5184 | | { |
|---|
| 5185 | | static const bool value = false; |
|---|
| 5186 | | }; |
|---|
| 5187 | | |
|---|
| 5188 | | template < typename T > |
|---|
| 5189 | | struct is_same<T, T> |
|---|
| 5190 | | { |
|---|
| 5191 | | static const bool value = true; |
|---|
| 5192 | | }; |
|---|
| 5193 | | |
|---|
| 5194 | | template < typename T1, typename T2 > |
|---|
| 5195 | | auto |
|---|
| 5196 | | add(T1 a1, T2 a2) -> decltype(a1 + a2) |
|---|
| 5197 | | { |
|---|
| 5198 | | return a1 + a2; |
|---|
| 5199 | | } |
|---|
| 5200 | | |
|---|
| 5201 | | int |
|---|
| 5202 | | test(const int c, volatile int v) |
|---|
| 5203 | | { |
|---|
| 5204 | | static_assert(is_same<int, decltype(0)>::value == true, ""); |
|---|
| 5205 | | static_assert(is_same<int, decltype(c)>::value == false, ""); |
|---|
| 5206 | | static_assert(is_same<int, decltype(v)>::value == false, ""); |
|---|
| 5207 | | auto ac = c; |
|---|
| 5208 | | auto av = v; |
|---|
| 5209 | | auto sumi = ac + av + 'x'; |
|---|
| 5210 | | auto sumf = ac + av + 1.0; |
|---|
| 5211 | | static_assert(is_same<int, decltype(ac)>::value == true, ""); |
|---|
| 5212 | | static_assert(is_same<int, decltype(av)>::value == true, ""); |
|---|
| 5213 | | static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
|---|
| 5214 | | static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
|---|
| 5215 | | static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
|---|
| 5216 | | return (sumf > 0.0) ? sumi : add(c, v); |
|---|
| 5217 | | } |
|---|
| 5218 | | |
|---|
| 5219 | | } |
|---|
| 5220 | | |
|---|
| 5221 | | namespace test_noexcept |
|---|
| 5222 | | { |
|---|
| 5223 | | |
|---|
| 5224 | | int f() { return 0; } |
|---|
| 5225 | | int g() noexcept { return 0; } |
|---|
| 5226 | | |
|---|
| 5227 | | static_assert(noexcept(f()) == false, ""); |
|---|
| 5228 | | static_assert(noexcept(g()) == true, ""); |
|---|
| 5229 | | |
|---|
| 5230 | | } |
|---|
| 5231 | | |
|---|
| 5232 | | namespace test_constexpr |
|---|
| 5233 | | { |
|---|
| 5234 | | |
|---|
| 5235 | | template < typename CharT > |
|---|
| 5236 | | unsigned long constexpr |
|---|
| 5237 | | strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
|---|
| 5238 | | { |
|---|
| 5239 | | return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
|---|
| 5240 | | } |
|---|
| 5241 | | |
|---|
| 5242 | | template < typename CharT > |
|---|
| 5243 | | unsigned long constexpr |
|---|
| 5244 | | strlen_c(const CharT *const s) noexcept |
|---|
| 5245 | | { |
|---|
| 5246 | | return strlen_c_r(s, 0UL); |
|---|
| 5247 | | } |
|---|
| 5248 | | |
|---|
| 5249 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 5250 | | static_assert(strlen_c("1") == 1UL, ""); |
|---|
| 5251 | | static_assert(strlen_c("example") == 7UL, ""); |
|---|
| 5252 | | static_assert(strlen_c("another\0example") == 7UL, ""); |
|---|
| 5253 | | |
|---|
| 5254 | | } |
|---|
| 5255 | | |
|---|
| 5256 | | namespace test_rvalue_references |
|---|
| 5257 | | { |
|---|
| 5258 | | |
|---|
| 5259 | | template < int N > |
|---|
| 5260 | | struct answer |
|---|
| 5261 | | { |
|---|
| 5262 | | static constexpr int value = N; |
|---|
| 5263 | | }; |
|---|
| 5264 | | |
|---|
| 5265 | | answer<1> f(int&) { return answer<1>(); } |
|---|
| 5266 | | answer<2> f(const int&) { return answer<2>(); } |
|---|
| 5267 | | answer<3> f(int&&) { return answer<3>(); } |
|---|
| 5268 | | |
|---|
| 5269 | | void |
|---|
| 5270 | | test() |
|---|
| 5271 | | { |
|---|
| 5272 | | int i = 0; |
|---|
| 5273 | | const int c = 0; |
|---|
| 5274 | | static_assert(decltype(f(i))::value == 1, ""); |
|---|
| 5275 | | static_assert(decltype(f(c))::value == 2, ""); |
|---|
| 5276 | | static_assert(decltype(f(0))::value == 3, ""); |
|---|
| 5277 | | } |
|---|
| 5278 | | |
|---|
| 5279 | | } |
|---|
| 5280 | | |
|---|
| 5281 | | namespace test_uniform_initialization |
|---|
| 5282 | | { |
|---|
| 5283 | | |
|---|
| 5284 | | struct test |
|---|
| 5285 | | { |
|---|
| 5286 | | static const int zero {}; |
|---|
| 5287 | | static const int one {1}; |
|---|
| 5288 | | }; |
|---|
| 5289 | | |
|---|
| 5290 | | static_assert(test::zero == 0, ""); |
|---|
| 5291 | | static_assert(test::one == 1, ""); |
|---|
| 5292 | | |
|---|
| 5293 | | } |
|---|
| 5294 | | |
|---|
| 5295 | | namespace test_lambdas |
|---|
| 5296 | | { |
|---|
| 5297 | | |
|---|
| 5298 | | void |
|---|
| 5299 | | test1() |
|---|
| 5300 | | { |
|---|
| 5301 | | auto lambda1 = [](){}; |
|---|
| 5302 | | auto lambda2 = lambda1; |
|---|
| 5303 | | lambda1(); |
|---|
| 5304 | | lambda2(); |
|---|
| 5305 | | } |
|---|
| 5306 | | |
|---|
| 5307 | | int |
|---|
| 5308 | | test2() |
|---|
| 5309 | | { |
|---|
| 5310 | | auto a = [](int i, int j){ return i + j; }(1, 2); |
|---|
| 5311 | | auto b = []() -> int { return '0'; }(); |
|---|
| 5312 | | auto c = [=](){ return a + b; }(); |
|---|
| 5313 | | auto d = [&](){ return c; }(); |
|---|
| 5314 | | auto e = [a, &b](int x) mutable { |
|---|
| 5315 | | const auto identity = [](int y){ return y; }; |
|---|
| 5316 | | for (auto i = 0; i < a; ++i) |
|---|
| 5317 | | a += b--; |
|---|
| 5318 | | return x + identity(a + b); |
|---|
| 5319 | | }(0); |
|---|
| 5320 | | return a + b + c + d + e; |
|---|
| 5321 | | } |
|---|
| 5322 | | |
|---|
| 5323 | | int |
|---|
| 5324 | | test3() |
|---|
| 5325 | | { |
|---|
| 5326 | | const auto nullary = [](){ return 0; }; |
|---|
| 5327 | | const auto unary = [](int x){ return x; }; |
|---|
| 5328 | | using nullary_t = decltype(nullary); |
|---|
| 5329 | | using unary_t = decltype(unary); |
|---|
| 5330 | | const auto higher1st = [](nullary_t f){ return f(); }; |
|---|
| 5331 | | const auto higher2nd = [unary](nullary_t f1){ |
|---|
| 5332 | | return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
|---|
| 5333 | | }; |
|---|
| 5334 | | return higher1st(nullary) + higher2nd(nullary)(unary); |
|---|
| 5335 | | } |
|---|
| 5336 | | |
|---|
| 5337 | | } |
|---|
| 5338 | | |
|---|
| 5339 | | namespace test_variadic_templates |
|---|
| 5340 | | { |
|---|
| 5341 | | |
|---|
| 5342 | | template <int...> |
|---|
| 5343 | | struct sum; |
|---|
| 5344 | | |
|---|
| 5345 | | template <int N0, int... N1toN> |
|---|
| 5346 | | struct sum<N0, N1toN...> |
|---|
| 5347 | | { |
|---|
| 5348 | | static constexpr auto value = N0 + sum<N1toN...>::value; |
|---|
| 5349 | | }; |
|---|
| 5350 | | |
|---|
| 5351 | | template <> |
|---|
| 5352 | | struct sum<> |
|---|
| 5353 | | { |
|---|
| 5354 | | static constexpr auto value = 0; |
|---|
| 5355 | | }; |
|---|
| 5356 | | |
|---|
| 5357 | | static_assert(sum<>::value == 0, ""); |
|---|
| 5358 | | static_assert(sum<1>::value == 1, ""); |
|---|
| 5359 | | static_assert(sum<23>::value == 23, ""); |
|---|
| 5360 | | static_assert(sum<1, 2>::value == 3, ""); |
|---|
| 5361 | | static_assert(sum<5, 5, 11>::value == 21, ""); |
|---|
| 5362 | | static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
|---|
| 5363 | | |
|---|
| 5364 | | } |
|---|
| 5365 | | |
|---|
| 5366 | | // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
|---|
| 5367 | | // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
|---|
| 5368 | | // because of this. |
|---|
| 5369 | | namespace test_template_alias_sfinae |
|---|
| 5370 | | { |
|---|
| 5371 | | |
|---|
| 5372 | | struct foo {}; |
|---|
| 5373 | | |
|---|
| 5374 | | template<typename T> |
|---|
| 5375 | | using member = typename T::member_type; |
|---|
| 5376 | | |
|---|
| 5377 | | template<typename T> |
|---|
| 5378 | | void func(...) {} |
|---|
| 5379 | | |
|---|
| 5380 | | template<typename T> |
|---|
| 5381 | | void func(member<T>*) {} |
|---|
| 5382 | | |
|---|
| 5383 | | void test(); |
|---|
| 5384 | | |
|---|
| 5385 | | void test() { func<foo>(0); } |
|---|
| 5386 | | |
|---|
| 5387 | | } |
|---|
| 5388 | | |
|---|
| 5389 | | } // namespace cxx11 |
|---|
| 5390 | | |
|---|
| 5391 | | #endif // __cplusplus >= 201103L |
|---|
| 5392 | | |
|---|
| 5393 | | |
|---|
| 5394 | | |
|---|
| 5395 | | |
|---|
| 5396 | | // If the compiler admits that it is not ready for C++14, why torture it? |
|---|
| 5397 | | // Hopefully, this will speed up the test. |
|---|
| 5398 | | |
|---|
| 5399 | | #ifndef __cplusplus |
|---|
| 5400 | | |
|---|
| 5401 | | #error "This is not a C++ compiler" |
|---|
| 5402 | | |
|---|
| 5403 | | #elif __cplusplus < 201402L |
|---|
| 5404 | | |
|---|
| 5405 | | #error "This is not a C++14 compiler" |
|---|
| 5406 | | |
|---|
| 5407 | | #else |
|---|
| 5408 | | |
|---|
| 5409 | | namespace cxx14 |
|---|
| 5410 | | { |
|---|
| 5411 | | |
|---|
| 5412 | | namespace test_polymorphic_lambdas |
|---|
| 5413 | | { |
|---|
| 5414 | | |
|---|
| 5415 | | int |
|---|
| 5416 | | test() |
|---|
| 5417 | | { |
|---|
| 5418 | | const auto lambda = [](auto&&... args){ |
|---|
| 5419 | | const auto istiny = [](auto x){ |
|---|
| 5420 | | return (sizeof(x) == 1UL) ? 1 : 0; |
|---|
| 5421 | | }; |
|---|
| 5422 | | const int aretiny[] = { istiny(args)... }; |
|---|
| 5423 | | return aretiny[0]; |
|---|
| 5424 | | }; |
|---|
| 5425 | | return lambda(1, 1L, 1.0f, '1'); |
|---|
| 5426 | | } |
|---|
| 5427 | | |
|---|
| 5428 | | } |
|---|
| 5429 | | |
|---|
| 5430 | | namespace test_binary_literals |
|---|
| 5431 | | { |
|---|
| 5432 | | |
|---|
| 5433 | | constexpr auto ivii = 0b0000000000101010; |
|---|
| 5434 | | static_assert(ivii == 42, "wrong value"); |
|---|
| 5435 | | |
|---|
| 5436 | | } |
|---|
| 5437 | | |
|---|
| 5438 | | namespace test_generalized_constexpr |
|---|
| 5439 | | { |
|---|
| 5440 | | |
|---|
| 5441 | | template < typename CharT > |
|---|
| 5442 | | constexpr unsigned long |
|---|
| 5443 | | strlen_c(const CharT *const s) noexcept |
|---|
| 5444 | | { |
|---|
| 5445 | | auto length = 0UL; |
|---|
| 5446 | | for (auto p = s; *p; ++p) |
|---|
| 5447 | | ++length; |
|---|
| 5448 | | return length; |
|---|
| 5449 | | } |
|---|
| 5450 | | |
|---|
| 5451 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 5452 | | static_assert(strlen_c("x") == 1UL, ""); |
|---|
| 5453 | | static_assert(strlen_c("test") == 4UL, ""); |
|---|
| 5454 | | static_assert(strlen_c("another\0test") == 7UL, ""); |
|---|
| 5455 | | |
|---|
| 5456 | | } |
|---|
| 5457 | | |
|---|
| 5458 | | namespace test_lambda_init_capture |
|---|
| 5459 | | { |
|---|
| 5460 | | |
|---|
| 5461 | | int |
|---|
| 5462 | | test() |
|---|
| 5463 | | { |
|---|
| 5464 | | auto x = 0; |
|---|
| 5465 | | const auto lambda1 = [a = x](int b){ return a + b; }; |
|---|
| 5466 | | const auto lambda2 = [a = lambda1(x)](){ return a; }; |
|---|
| 5467 | | return lambda2(); |
|---|
| 5468 | | } |
|---|
| 5469 | | |
|---|
| 5470 | | } |
|---|
| 5471 | | |
|---|
| 5472 | | namespace test_digit_separators |
|---|
| 5473 | | { |
|---|
| 5474 | | |
|---|
| 5475 | | constexpr auto ten_million = 100'000'000; |
|---|
| 5476 | | static_assert(ten_million == 100000000, ""); |
|---|
| 5477 | | |
|---|
| 5478 | | } |
|---|
| 5479 | | |
|---|
| 5480 | | namespace test_return_type_deduction |
|---|
| 5481 | | { |
|---|
| 5482 | | |
|---|
| 5483 | | auto f(int& x) { return x; } |
|---|
| 5484 | | decltype(auto) g(int& x) { return x; } |
|---|
| 5485 | | |
|---|
| 5486 | | template < typename T1, typename T2 > |
|---|
| 5487 | | struct is_same |
|---|
| 5488 | | { |
|---|
| 5489 | | static constexpr auto value = false; |
|---|
| 5490 | | }; |
|---|
| 5491 | | |
|---|
| 5492 | | template < typename T > |
|---|
| 5493 | | struct is_same<T, T> |
|---|
| 5494 | | { |
|---|
| 5495 | | static constexpr auto value = true; |
|---|
| 5496 | | }; |
|---|
| 5497 | | |
|---|
| 5498 | | int |
|---|
| 5499 | | test() |
|---|
| 5500 | | { |
|---|
| 5501 | | auto x = 0; |
|---|
| 5502 | | static_assert(is_same<int, decltype(f(x))>::value, ""); |
|---|
| 5503 | | static_assert(is_same<int&, decltype(g(x))>::value, ""); |
|---|
| 5504 | | return x; |
|---|
| 5505 | | } |
|---|
| 5506 | | |
|---|
| 5507 | | } |
|---|
| 5508 | | |
|---|
| 5509 | | } // namespace cxx14 |
|---|
| 5510 | | |
|---|
| 5511 | | #endif // __cplusplus >= 201402L |
|---|
| 5512 | | |
|---|
| 5513 | | |
|---|
| 5514 | | |
|---|
| 5515 | | |
|---|
| 5516 | | // If the compiler admits that it is not ready for C++17, why torture it? |
|---|
| 5517 | | // Hopefully, this will speed up the test. |
|---|
| 5518 | | |
|---|
| 5519 | | #ifndef __cplusplus |
|---|
| 5520 | | |
|---|
| 5521 | | #error "This is not a C++ compiler" |
|---|
| 5522 | | |
|---|
| 5523 | | #elif __cplusplus < 201703L |
|---|
| 5524 | | |
|---|
| 5525 | | #error "This is not a C++17 compiler" |
|---|
| 5526 | | |
|---|
| 5527 | | #else |
|---|
| 5528 | | |
|---|
| 5529 | | #include <initializer_list> |
|---|
| 5530 | | #include <utility> |
|---|
| 5531 | | #include <type_traits> |
|---|
| 5532 | | |
|---|
| 5533 | | namespace cxx17 |
|---|
| 5534 | | { |
|---|
| 5535 | | |
|---|
| 5536 | | namespace test_constexpr_lambdas |
|---|
| 5537 | | { |
|---|
| 5538 | | |
|---|
| 5539 | | constexpr int foo = [](){return 42;}(); |
|---|
| 5540 | | |
|---|
| 5541 | | } |
|---|
| 5542 | | |
|---|
| 5543 | | namespace test::nested_namespace::definitions |
|---|
| 5544 | | { |
|---|
| 5545 | | |
|---|
| 5546 | | } |
|---|
| 5547 | | |
|---|
| 5548 | | namespace test_fold_expression |
|---|
| 5549 | | { |
|---|
| 5550 | | |
|---|
| 5551 | | template<typename... Args> |
|---|
| 5552 | | int multiply(Args... args) |
|---|
| 5553 | | { |
|---|
| 5554 | | return (args * ... * 1); |
|---|
| 5555 | | } |
|---|
| 5556 | | |
|---|
| 5557 | | template<typename... Args> |
|---|
| 5558 | | bool all(Args... args) |
|---|
| 5559 | | { |
|---|
| 5560 | | return (args && ...); |
|---|
| 5561 | | } |
|---|
| 5562 | | |
|---|
| 5563 | | } |
|---|
| 5564 | | |
|---|
| 5565 | | namespace test_extended_static_assert |
|---|
| 5566 | | { |
|---|
| 5567 | | |
|---|
| 5568 | | static_assert (true); |
|---|
| 5569 | | |
|---|
| 5570 | | } |
|---|
| 5571 | | |
|---|
| 5572 | | namespace test_auto_brace_init_list |
|---|
| 5573 | | { |
|---|
| 5574 | | |
|---|
| 5575 | | auto foo = {5}; |
|---|
| 5576 | | auto bar {5}; |
|---|
| 5577 | | |
|---|
| 5578 | | static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
|---|
| 5579 | | static_assert(std::is_same<int, decltype(bar)>::value); |
|---|
| 5580 | | } |
|---|
| 5581 | | |
|---|
| 5582 | | namespace test_typename_in_template_template_parameter |
|---|
| 5583 | | { |
|---|
| 5584 | | |
|---|
| 5585 | | template<template<typename> typename X> struct D; |
|---|
| 5586 | | |
|---|
| 5587 | | } |
|---|
| 5588 | | |
|---|
| 5589 | | namespace test_fallthrough_nodiscard_maybe_unused_attributes |
|---|
| 5590 | | { |
|---|
| 5591 | | |
|---|
| 5592 | | int f1() |
|---|
| 5593 | | { |
|---|
| 5594 | | return 42; |
|---|
| 5595 | | } |
|---|
| 5596 | | |
|---|
| 5597 | | [[nodiscard]] int f2() |
|---|
| 5598 | | { |
|---|
| 5599 | | [[maybe_unused]] auto unused = f1(); |
|---|
| 5600 | | |
|---|
| 5601 | | switch (f1()) |
|---|
| 5602 | | { |
|---|
| 5603 | | case 17: |
|---|
| 5604 | | f1(); |
|---|
| 5605 | | [[fallthrough]]; |
|---|
| 5606 | | case 42: |
|---|
| 5607 | | f1(); |
|---|
| 5608 | | } |
|---|
| 5609 | | return f1(); |
|---|
| 5610 | | } |
|---|
| 5611 | | |
|---|
| 5612 | | } |
|---|
| 5613 | | |
|---|
| 5614 | | namespace test_extended_aggregate_initialization |
|---|
| 5615 | | { |
|---|
| 5616 | | |
|---|
| 5617 | | struct base1 |
|---|
| 5618 | | { |
|---|
| 5619 | | int b1, b2 = 42; |
|---|
| 5620 | | }; |
|---|
| 5621 | | |
|---|
| 5622 | | struct base2 |
|---|
| 5623 | | { |
|---|
| 5624 | | base2() { |
|---|
| 5625 | | b3 = 42; |
|---|
| 5626 | | } |
|---|
| 5627 | | int b3; |
|---|
| 5628 | | }; |
|---|
| 5629 | | |
|---|
| 5630 | | struct derived : base1, base2 |
|---|
| 5631 | | { |
|---|
| 5632 | | int d; |
|---|
| 5633 | | }; |
|---|
| 5634 | | |
|---|
| 5635 | | derived d1 {{1, 2}, {}, 4}; // full initialization |
|---|
| 5636 | | derived d2 {{}, {}, 4}; // value-initialized bases |
|---|
| 5637 | | |
|---|
| 5638 | | } |
|---|
| 5639 | | |
|---|
| 5640 | | namespace test_general_range_based_for_loop |
|---|
| 5641 | | { |
|---|
| 5642 | | |
|---|
| 5643 | | struct iter |
|---|
| 5644 | | { |
|---|
| 5645 | | int i; |
|---|
| 5646 | | |
|---|
| 5647 | | int& operator* () |
|---|
| 5648 | | { |
|---|
| 5649 | | return i; |
|---|
| 5650 | | } |
|---|
| 5651 | | |
|---|
| 5652 | | const int& operator* () const |
|---|
| 5653 | | { |
|---|
| 5654 | | return i; |
|---|
| 5655 | | } |
|---|
| 5656 | | |
|---|
| 5657 | | iter& operator++() |
|---|
| 5658 | | { |
|---|
| 5659 | | ++i; |
|---|
| 5660 | | return *this; |
|---|
| 5661 | | } |
|---|
| 5662 | | }; |
|---|
| 5663 | | |
|---|
| 5664 | | struct sentinel |
|---|
| 5665 | | { |
|---|
| 5666 | | int i; |
|---|
| 5667 | | }; |
|---|
| 5668 | | |
|---|
| 5669 | | bool operator== (const iter& i, const sentinel& s) |
|---|
| 5670 | | { |
|---|
| 5671 | | return i.i == s.i; |
|---|
| 5672 | | } |
|---|
| 5673 | | |
|---|
| 5674 | | bool operator!= (const iter& i, const sentinel& s) |
|---|
| 5675 | | { |
|---|
| 5676 | | return !(i == s); |
|---|
| 5677 | | } |
|---|
| 5678 | | |
|---|
| 5679 | | struct range |
|---|
| 5680 | | { |
|---|
| 5681 | | iter begin() const |
|---|
| 5682 | | { |
|---|
| 5683 | | return {0}; |
|---|
| 5684 | | } |
|---|
| 5685 | | |
|---|
| 5686 | | sentinel end() const |
|---|
| 5687 | | { |
|---|
| 5688 | | return {5}; |
|---|
| 5689 | | } |
|---|
| 5690 | | }; |
|---|
| 5691 | | |
|---|
| 5692 | | void f() |
|---|
| 5693 | | { |
|---|
| 5694 | | range r {}; |
|---|
| 5695 | | |
|---|
| 5696 | | for (auto i : r) |
|---|
| 5697 | | { |
|---|
| 5698 | | [[maybe_unused]] auto v = i; |
|---|
| 5699 | | } |
|---|
| 5700 | | } |
|---|
| 5701 | | |
|---|
| 5702 | | } |
|---|
| 5703 | | |
|---|
| 5704 | | namespace test_lambda_capture_asterisk_this_by_value |
|---|
| 5705 | | { |
|---|
| 5706 | | |
|---|
| 5707 | | struct t |
|---|
| 5708 | | { |
|---|
| 5709 | | int i; |
|---|
| 5710 | | int foo() |
|---|
| 5711 | | { |
|---|
| 5712 | | return [*this]() |
|---|
| 5713 | | { |
|---|
| 5714 | | return i; |
|---|
| 5715 | | }(); |
|---|
| 5716 | | } |
|---|
| 5717 | | }; |
|---|
| 5718 | | |
|---|
| 5719 | | } |
|---|
| 5720 | | |
|---|
| 5721 | | namespace test_enum_class_construction |
|---|
| 5722 | | { |
|---|
| 5723 | | |
|---|
| 5724 | | enum class byte : unsigned char |
|---|
| 5725 | | {}; |
|---|
| 5726 | | |
|---|
| 5727 | | byte foo {42}; |
|---|
| 5728 | | |
|---|
| 5729 | | } |
|---|
| 5730 | | |
|---|
| 5731 | | namespace test_constexpr_if |
|---|
| 5732 | | { |
|---|
| 5733 | | |
|---|
| 5734 | | template <bool cond> |
|---|
| 5735 | | int f () |
|---|
| 5736 | | { |
|---|
| 5737 | | if constexpr(cond) |
|---|
| 5738 | | { |
|---|
| 5739 | | return 13; |
|---|
| 5740 | | } |
|---|
| 5741 | | else |
|---|
| 5742 | | { |
|---|
| 5743 | | return 42; |
|---|
| 5744 | | } |
|---|
| 5745 | | } |
|---|
| 5746 | | |
|---|
| 5747 | | } |
|---|
| 5748 | | |
|---|
| 5749 | | namespace test_selection_statement_with_initializer |
|---|
| 5750 | | { |
|---|
| 5751 | | |
|---|
| 5752 | | int f() |
|---|
| 5753 | | { |
|---|
| 5754 | | return 13; |
|---|
| 5755 | | } |
|---|
| 5756 | | |
|---|
| 5757 | | int f2() |
|---|
| 5758 | | { |
|---|
| 5759 | | if (auto i = f(); i > 0) |
|---|
| 5760 | | { |
|---|
| 5761 | | return 3; |
|---|
| 5762 | | } |
|---|
| 5763 | | |
|---|
| 5764 | | switch (auto i = f(); i + 4) |
|---|
| 5765 | | { |
|---|
| 5766 | | case 17: |
|---|
| 5767 | | return 2; |
|---|
| 5768 | | |
|---|
| 5769 | | default: |
|---|
| 5770 | | return 1; |
|---|
| 5771 | | } |
|---|
| 5772 | | } |
|---|
| 5773 | | |
|---|
| 5774 | | } |
|---|
| 5775 | | |
|---|
| 5776 | | namespace test_template_argument_deduction_for_class_templates |
|---|
| 5777 | | { |
|---|
| 5778 | | |
|---|
| 5779 | | template <typename T1, typename T2> |
|---|
| 5780 | | struct pair |
|---|
| 5781 | | { |
|---|
| 5782 | | pair (T1 p1, T2 p2) |
|---|
| 5783 | | : m1 {p1}, |
|---|
| 5784 | | m2 {p2} |
|---|
| 5785 | | {} |
|---|
| 5786 | | |
|---|
| 5787 | | T1 m1; |
|---|
| 5788 | | T2 m2; |
|---|
| 5789 | | }; |
|---|
| 5790 | | |
|---|
| 5791 | | void f() |
|---|
| 5792 | | { |
|---|
| 5793 | | [[maybe_unused]] auto p = pair{13, 42u}; |
|---|
| 5794 | | } |
|---|
| 5795 | | |
|---|
| 5796 | | } |
|---|
| 5797 | | |
|---|
| 5798 | | namespace test_non_type_auto_template_parameters |
|---|
| 5799 | | { |
|---|
| 5800 | | |
|---|
| 5801 | | template <auto n> |
|---|
| 5802 | | struct B |
|---|
| 5803 | | {}; |
|---|
| 5804 | | |
|---|
| 5805 | | B<5> b1; |
|---|
| 5806 | | B<'a'> b2; |
|---|
| 5807 | | |
|---|
| 5808 | | } |
|---|
| 5809 | | |
|---|
| 5810 | | namespace test_structured_bindings |
|---|
| 5811 | | { |
|---|
| 5812 | | |
|---|
| 5813 | | int arr[2] = { 1, 2 }; |
|---|
| 5814 | | std::pair<int, int> pr = { 1, 2 }; |
|---|
| 5815 | | |
|---|
| 5816 | | auto f1() -> int(&)[2] |
|---|
| 5817 | | { |
|---|
| 5818 | | return arr; |
|---|
| 5819 | | } |
|---|
| 5820 | | |
|---|
| 5821 | | auto f2() -> std::pair<int, int>& |
|---|
| 5822 | | { |
|---|
| 5823 | | return pr; |
|---|
| 5824 | | } |
|---|
| 5825 | | |
|---|
| 5826 | | struct S |
|---|
| 5827 | | { |
|---|
| 5828 | | int x1 : 2; |
|---|
| 5829 | | volatile double y1; |
|---|
| 5830 | | }; |
|---|
| 5831 | | |
|---|
| 5832 | | S f3() |
|---|
| 5833 | | { |
|---|
| 5834 | | return {}; |
|---|
| 5835 | | } |
|---|
| 5836 | | |
|---|
| 5837 | | auto [ x1, y1 ] = f1(); |
|---|
| 5838 | | auto& [ xr1, yr1 ] = f1(); |
|---|
| 5839 | | auto [ x2, y2 ] = f2(); |
|---|
| 5840 | | auto& [ xr2, yr2 ] = f2(); |
|---|
| 5841 | | const auto [ x3, y3 ] = f3(); |
|---|
| 5842 | | |
|---|
| 5843 | | } |
|---|
| 5844 | | |
|---|
| 5845 | | namespace test_exception_spec_type_system |
|---|
| 5846 | | { |
|---|
| 5847 | | |
|---|
| 5848 | | struct Good {}; |
|---|
| 5849 | | struct Bad {}; |
|---|
| 5850 | | |
|---|
| 5851 | | void g1() noexcept; |
|---|
| 5852 | | void g2(); |
|---|
| 5853 | | |
|---|
| 5854 | | template<typename T> |
|---|
| 5855 | | Bad |
|---|
| 5856 | | f(T*, T*); |
|---|
| 5857 | | |
|---|
| 5858 | | template<typename T1, typename T2> |
|---|
| 5859 | | Good |
|---|
| 5860 | | f(T1*, T2*); |
|---|
| 5861 | | |
|---|
| 5862 | | static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
|---|
| 5863 | | |
|---|
| 5864 | | } |
|---|
| 5865 | | |
|---|
| 5866 | | namespace test_inline_variables |
|---|
| 5867 | | { |
|---|
| 5868 | | |
|---|
| 5869 | | template<class T> void f(T) |
|---|
| 5870 | | {} |
|---|
| 5871 | | |
|---|
| 5872 | | template<class T> inline T g(T) |
|---|
| 5873 | | { |
|---|
| 5874 | | return T{}; |
|---|
| 5875 | | } |
|---|
| 5876 | | |
|---|
| 5877 | | template<> inline void f<>(int) |
|---|
| 5878 | | {} |
|---|
| 5879 | | |
|---|
| 5880 | | template<> int g<>(int) |
|---|
| 5881 | | { |
|---|
| 5882 | | return 5; |
|---|
| 5883 | | } |
|---|
| 5884 | | |
|---|
| 5885 | | } |
|---|
| 5886 | | |
|---|
| 5887 | | } // namespace cxx17 |
|---|
| 5888 | | |
|---|
| 5889 | | #endif // __cplusplus < 201703L |
|---|
| 5890 | | |
|---|
| 5891 | | |
|---|
| 5892 | | |
|---|
| 5893 | configure:21015: result: no |
|---|
| 5894 | configure:20206: checking whether /usr/bin/clang++ supports C++17 features with +std=c++1z |
|---|
| 5895 | configure:21003: /usr/bin/clang++ +std=c++1z -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 5896 | clang++: error: no such file or directory: '+std=c++1z'; did you mean '-std=c++1z'? |
|---|
| 5897 | configure:21003: $? = 1 |
|---|
| 5898 | configure: failed program was: |
|---|
| 5899 | | /* confdefs.h */ |
|---|
| 5900 | | #define PACKAGE_NAME "graphviz" |
|---|
| 5901 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 5902 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 5903 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 5904 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 5905 | | #define PACKAGE_URL "" |
|---|
| 5906 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 5907 | | #define GVPLUGIN_VERSION 6 |
|---|
| 5908 | | #define DARWIN 1 |
|---|
| 5909 | | #define DARWIN_DYLIB "" |
|---|
| 5910 | | #define DEFAULT_DPI 96 |
|---|
| 5911 | | #define BROWSER "open" |
|---|
| 5912 | | #define YYTEXT_POINTER 1 |
|---|
| 5913 | | #define HAVE_STDIO_H 1 |
|---|
| 5914 | | #define HAVE_STDLIB_H 1 |
|---|
| 5915 | | #define HAVE_STRING_H 1 |
|---|
| 5916 | | #define HAVE_INTTYPES_H 1 |
|---|
| 5917 | | #define HAVE_STDINT_H 1 |
|---|
| 5918 | | #define HAVE_STRINGS_H 1 |
|---|
| 5919 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 5920 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 5921 | | #define HAVE_UNISTD_H 1 |
|---|
| 5922 | | #define STDC_HEADERS 1 |
|---|
| 5923 | | #define HAVE_DLFCN_H 1 |
|---|
| 5924 | | #define LT_OBJDIR ".libs/" |
|---|
| 5925 | | /* end confdefs.h. */ |
|---|
| 5926 | | |
|---|
| 5927 | | |
|---|
| 5928 | | // If the compiler admits that it is not ready for C++11, why torture it? |
|---|
| 5929 | | // Hopefully, this will speed up the test. |
|---|
| 5930 | | |
|---|
| 5931 | | #ifndef __cplusplus |
|---|
| 5932 | | |
|---|
| 5933 | | #error "This is not a C++ compiler" |
|---|
| 5934 | | |
|---|
| 5935 | | #elif __cplusplus < 201103L |
|---|
| 5936 | | |
|---|
| 5937 | | #error "This is not a C++11 compiler" |
|---|
| 5938 | | |
|---|
| 5939 | | #else |
|---|
| 5940 | | |
|---|
| 5941 | | namespace cxx11 |
|---|
| 5942 | | { |
|---|
| 5943 | | |
|---|
| 5944 | | namespace test_static_assert |
|---|
| 5945 | | { |
|---|
| 5946 | | |
|---|
| 5947 | | template <typename T> |
|---|
| 5948 | | struct check |
|---|
| 5949 | | { |
|---|
| 5950 | | static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
|---|
| 5951 | | }; |
|---|
| 5952 | | |
|---|
| 5953 | | } |
|---|
| 5954 | | |
|---|
| 5955 | | namespace test_final_override |
|---|
| 5956 | | { |
|---|
| 5957 | | |
|---|
| 5958 | | struct Base |
|---|
| 5959 | | { |
|---|
| 5960 | | virtual ~Base() {} |
|---|
| 5961 | | virtual void f() {} |
|---|
| 5962 | | }; |
|---|
| 5963 | | |
|---|
| 5964 | | struct Derived : public Base |
|---|
| 5965 | | { |
|---|
| 5966 | | virtual ~Derived() override {} |
|---|
| 5967 | | virtual void f() override {} |
|---|
| 5968 | | }; |
|---|
| 5969 | | |
|---|
| 5970 | | } |
|---|
| 5971 | | |
|---|
| 5972 | | namespace test_double_right_angle_brackets |
|---|
| 5973 | | { |
|---|
| 5974 | | |
|---|
| 5975 | | template < typename T > |
|---|
| 5976 | | struct check {}; |
|---|
| 5977 | | |
|---|
| 5978 | | typedef check<void> single_type; |
|---|
| 5979 | | typedef check<check<void>> double_type; |
|---|
| 5980 | | typedef check<check<check<void>>> triple_type; |
|---|
| 5981 | | typedef check<check<check<check<void>>>> quadruple_type; |
|---|
| 5982 | | |
|---|
| 5983 | | } |
|---|
| 5984 | | |
|---|
| 5985 | | namespace test_decltype |
|---|
| 5986 | | { |
|---|
| 5987 | | |
|---|
| 5988 | | int |
|---|
| 5989 | | f() |
|---|
| 5990 | | { |
|---|
| 5991 | | int a = 1; |
|---|
| 5992 | | decltype(a) b = 2; |
|---|
| 5993 | | return a + b; |
|---|
| 5994 | | } |
|---|
| 5995 | | |
|---|
| 5996 | | } |
|---|
| 5997 | | |
|---|
| 5998 | | namespace test_type_deduction |
|---|
| 5999 | | { |
|---|
| 6000 | | |
|---|
| 6001 | | template < typename T1, typename T2 > |
|---|
| 6002 | | struct is_same |
|---|
| 6003 | | { |
|---|
| 6004 | | static const bool value = false; |
|---|
| 6005 | | }; |
|---|
| 6006 | | |
|---|
| 6007 | | template < typename T > |
|---|
| 6008 | | struct is_same<T, T> |
|---|
| 6009 | | { |
|---|
| 6010 | | static const bool value = true; |
|---|
| 6011 | | }; |
|---|
| 6012 | | |
|---|
| 6013 | | template < typename T1, typename T2 > |
|---|
| 6014 | | auto |
|---|
| 6015 | | add(T1 a1, T2 a2) -> decltype(a1 + a2) |
|---|
| 6016 | | { |
|---|
| 6017 | | return a1 + a2; |
|---|
| 6018 | | } |
|---|
| 6019 | | |
|---|
| 6020 | | int |
|---|
| 6021 | | test(const int c, volatile int v) |
|---|
| 6022 | | { |
|---|
| 6023 | | static_assert(is_same<int, decltype(0)>::value == true, ""); |
|---|
| 6024 | | static_assert(is_same<int, decltype(c)>::value == false, ""); |
|---|
| 6025 | | static_assert(is_same<int, decltype(v)>::value == false, ""); |
|---|
| 6026 | | auto ac = c; |
|---|
| 6027 | | auto av = v; |
|---|
| 6028 | | auto sumi = ac + av + 'x'; |
|---|
| 6029 | | auto sumf = ac + av + 1.0; |
|---|
| 6030 | | static_assert(is_same<int, decltype(ac)>::value == true, ""); |
|---|
| 6031 | | static_assert(is_same<int, decltype(av)>::value == true, ""); |
|---|
| 6032 | | static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
|---|
| 6033 | | static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
|---|
| 6034 | | static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
|---|
| 6035 | | return (sumf > 0.0) ? sumi : add(c, v); |
|---|
| 6036 | | } |
|---|
| 6037 | | |
|---|
| 6038 | | } |
|---|
| 6039 | | |
|---|
| 6040 | | namespace test_noexcept |
|---|
| 6041 | | { |
|---|
| 6042 | | |
|---|
| 6043 | | int f() { return 0; } |
|---|
| 6044 | | int g() noexcept { return 0; } |
|---|
| 6045 | | |
|---|
| 6046 | | static_assert(noexcept(f()) == false, ""); |
|---|
| 6047 | | static_assert(noexcept(g()) == true, ""); |
|---|
| 6048 | | |
|---|
| 6049 | | } |
|---|
| 6050 | | |
|---|
| 6051 | | namespace test_constexpr |
|---|
| 6052 | | { |
|---|
| 6053 | | |
|---|
| 6054 | | template < typename CharT > |
|---|
| 6055 | | unsigned long constexpr |
|---|
| 6056 | | strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
|---|
| 6057 | | { |
|---|
| 6058 | | return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
|---|
| 6059 | | } |
|---|
| 6060 | | |
|---|
| 6061 | | template < typename CharT > |
|---|
| 6062 | | unsigned long constexpr |
|---|
| 6063 | | strlen_c(const CharT *const s) noexcept |
|---|
| 6064 | | { |
|---|
| 6065 | | return strlen_c_r(s, 0UL); |
|---|
| 6066 | | } |
|---|
| 6067 | | |
|---|
| 6068 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 6069 | | static_assert(strlen_c("1") == 1UL, ""); |
|---|
| 6070 | | static_assert(strlen_c("example") == 7UL, ""); |
|---|
| 6071 | | static_assert(strlen_c("another\0example") == 7UL, ""); |
|---|
| 6072 | | |
|---|
| 6073 | | } |
|---|
| 6074 | | |
|---|
| 6075 | | namespace test_rvalue_references |
|---|
| 6076 | | { |
|---|
| 6077 | | |
|---|
| 6078 | | template < int N > |
|---|
| 6079 | | struct answer |
|---|
| 6080 | | { |
|---|
| 6081 | | static constexpr int value = N; |
|---|
| 6082 | | }; |
|---|
| 6083 | | |
|---|
| 6084 | | answer<1> f(int&) { return answer<1>(); } |
|---|
| 6085 | | answer<2> f(const int&) { return answer<2>(); } |
|---|
| 6086 | | answer<3> f(int&&) { return answer<3>(); } |
|---|
| 6087 | | |
|---|
| 6088 | | void |
|---|
| 6089 | | test() |
|---|
| 6090 | | { |
|---|
| 6091 | | int i = 0; |
|---|
| 6092 | | const int c = 0; |
|---|
| 6093 | | static_assert(decltype(f(i))::value == 1, ""); |
|---|
| 6094 | | static_assert(decltype(f(c))::value == 2, ""); |
|---|
| 6095 | | static_assert(decltype(f(0))::value == 3, ""); |
|---|
| 6096 | | } |
|---|
| 6097 | | |
|---|
| 6098 | | } |
|---|
| 6099 | | |
|---|
| 6100 | | namespace test_uniform_initialization |
|---|
| 6101 | | { |
|---|
| 6102 | | |
|---|
| 6103 | | struct test |
|---|
| 6104 | | { |
|---|
| 6105 | | static const int zero {}; |
|---|
| 6106 | | static const int one {1}; |
|---|
| 6107 | | }; |
|---|
| 6108 | | |
|---|
| 6109 | | static_assert(test::zero == 0, ""); |
|---|
| 6110 | | static_assert(test::one == 1, ""); |
|---|
| 6111 | | |
|---|
| 6112 | | } |
|---|
| 6113 | | |
|---|
| 6114 | | namespace test_lambdas |
|---|
| 6115 | | { |
|---|
| 6116 | | |
|---|
| 6117 | | void |
|---|
| 6118 | | test1() |
|---|
| 6119 | | { |
|---|
| 6120 | | auto lambda1 = [](){}; |
|---|
| 6121 | | auto lambda2 = lambda1; |
|---|
| 6122 | | lambda1(); |
|---|
| 6123 | | lambda2(); |
|---|
| 6124 | | } |
|---|
| 6125 | | |
|---|
| 6126 | | int |
|---|
| 6127 | | test2() |
|---|
| 6128 | | { |
|---|
| 6129 | | auto a = [](int i, int j){ return i + j; }(1, 2); |
|---|
| 6130 | | auto b = []() -> int { return '0'; }(); |
|---|
| 6131 | | auto c = [=](){ return a + b; }(); |
|---|
| 6132 | | auto d = [&](){ return c; }(); |
|---|
| 6133 | | auto e = [a, &b](int x) mutable { |
|---|
| 6134 | | const auto identity = [](int y){ return y; }; |
|---|
| 6135 | | for (auto i = 0; i < a; ++i) |
|---|
| 6136 | | a += b--; |
|---|
| 6137 | | return x + identity(a + b); |
|---|
| 6138 | | }(0); |
|---|
| 6139 | | return a + b + c + d + e; |
|---|
| 6140 | | } |
|---|
| 6141 | | |
|---|
| 6142 | | int |
|---|
| 6143 | | test3() |
|---|
| 6144 | | { |
|---|
| 6145 | | const auto nullary = [](){ return 0; }; |
|---|
| 6146 | | const auto unary = [](int x){ return x; }; |
|---|
| 6147 | | using nullary_t = decltype(nullary); |
|---|
| 6148 | | using unary_t = decltype(unary); |
|---|
| 6149 | | const auto higher1st = [](nullary_t f){ return f(); }; |
|---|
| 6150 | | const auto higher2nd = [unary](nullary_t f1){ |
|---|
| 6151 | | return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
|---|
| 6152 | | }; |
|---|
| 6153 | | return higher1st(nullary) + higher2nd(nullary)(unary); |
|---|
| 6154 | | } |
|---|
| 6155 | | |
|---|
| 6156 | | } |
|---|
| 6157 | | |
|---|
| 6158 | | namespace test_variadic_templates |
|---|
| 6159 | | { |
|---|
| 6160 | | |
|---|
| 6161 | | template <int...> |
|---|
| 6162 | | struct sum; |
|---|
| 6163 | | |
|---|
| 6164 | | template <int N0, int... N1toN> |
|---|
| 6165 | | struct sum<N0, N1toN...> |
|---|
| 6166 | | { |
|---|
| 6167 | | static constexpr auto value = N0 + sum<N1toN...>::value; |
|---|
| 6168 | | }; |
|---|
| 6169 | | |
|---|
| 6170 | | template <> |
|---|
| 6171 | | struct sum<> |
|---|
| 6172 | | { |
|---|
| 6173 | | static constexpr auto value = 0; |
|---|
| 6174 | | }; |
|---|
| 6175 | | |
|---|
| 6176 | | static_assert(sum<>::value == 0, ""); |
|---|
| 6177 | | static_assert(sum<1>::value == 1, ""); |
|---|
| 6178 | | static_assert(sum<23>::value == 23, ""); |
|---|
| 6179 | | static_assert(sum<1, 2>::value == 3, ""); |
|---|
| 6180 | | static_assert(sum<5, 5, 11>::value == 21, ""); |
|---|
| 6181 | | static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
|---|
| 6182 | | |
|---|
| 6183 | | } |
|---|
| 6184 | | |
|---|
| 6185 | | // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
|---|
| 6186 | | // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
|---|
| 6187 | | // because of this. |
|---|
| 6188 | | namespace test_template_alias_sfinae |
|---|
| 6189 | | { |
|---|
| 6190 | | |
|---|
| 6191 | | struct foo {}; |
|---|
| 6192 | | |
|---|
| 6193 | | template<typename T> |
|---|
| 6194 | | using member = typename T::member_type; |
|---|
| 6195 | | |
|---|
| 6196 | | template<typename T> |
|---|
| 6197 | | void func(...) {} |
|---|
| 6198 | | |
|---|
| 6199 | | template<typename T> |
|---|
| 6200 | | void func(member<T>*) {} |
|---|
| 6201 | | |
|---|
| 6202 | | void test(); |
|---|
| 6203 | | |
|---|
| 6204 | | void test() { func<foo>(0); } |
|---|
| 6205 | | |
|---|
| 6206 | | } |
|---|
| 6207 | | |
|---|
| 6208 | | } // namespace cxx11 |
|---|
| 6209 | | |
|---|
| 6210 | | #endif // __cplusplus >= 201103L |
|---|
| 6211 | | |
|---|
| 6212 | | |
|---|
| 6213 | | |
|---|
| 6214 | | |
|---|
| 6215 | | // If the compiler admits that it is not ready for C++14, why torture it? |
|---|
| 6216 | | // Hopefully, this will speed up the test. |
|---|
| 6217 | | |
|---|
| 6218 | | #ifndef __cplusplus |
|---|
| 6219 | | |
|---|
| 6220 | | #error "This is not a C++ compiler" |
|---|
| 6221 | | |
|---|
| 6222 | | #elif __cplusplus < 201402L |
|---|
| 6223 | | |
|---|
| 6224 | | #error "This is not a C++14 compiler" |
|---|
| 6225 | | |
|---|
| 6226 | | #else |
|---|
| 6227 | | |
|---|
| 6228 | | namespace cxx14 |
|---|
| 6229 | | { |
|---|
| 6230 | | |
|---|
| 6231 | | namespace test_polymorphic_lambdas |
|---|
| 6232 | | { |
|---|
| 6233 | | |
|---|
| 6234 | | int |
|---|
| 6235 | | test() |
|---|
| 6236 | | { |
|---|
| 6237 | | const auto lambda = [](auto&&... args){ |
|---|
| 6238 | | const auto istiny = [](auto x){ |
|---|
| 6239 | | return (sizeof(x) == 1UL) ? 1 : 0; |
|---|
| 6240 | | }; |
|---|
| 6241 | | const int aretiny[] = { istiny(args)... }; |
|---|
| 6242 | | return aretiny[0]; |
|---|
| 6243 | | }; |
|---|
| 6244 | | return lambda(1, 1L, 1.0f, '1'); |
|---|
| 6245 | | } |
|---|
| 6246 | | |
|---|
| 6247 | | } |
|---|
| 6248 | | |
|---|
| 6249 | | namespace test_binary_literals |
|---|
| 6250 | | { |
|---|
| 6251 | | |
|---|
| 6252 | | constexpr auto ivii = 0b0000000000101010; |
|---|
| 6253 | | static_assert(ivii == 42, "wrong value"); |
|---|
| 6254 | | |
|---|
| 6255 | | } |
|---|
| 6256 | | |
|---|
| 6257 | | namespace test_generalized_constexpr |
|---|
| 6258 | | { |
|---|
| 6259 | | |
|---|
| 6260 | | template < typename CharT > |
|---|
| 6261 | | constexpr unsigned long |
|---|
| 6262 | | strlen_c(const CharT *const s) noexcept |
|---|
| 6263 | | { |
|---|
| 6264 | | auto length = 0UL; |
|---|
| 6265 | | for (auto p = s; *p; ++p) |
|---|
| 6266 | | ++length; |
|---|
| 6267 | | return length; |
|---|
| 6268 | | } |
|---|
| 6269 | | |
|---|
| 6270 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 6271 | | static_assert(strlen_c("x") == 1UL, ""); |
|---|
| 6272 | | static_assert(strlen_c("test") == 4UL, ""); |
|---|
| 6273 | | static_assert(strlen_c("another\0test") == 7UL, ""); |
|---|
| 6274 | | |
|---|
| 6275 | | } |
|---|
| 6276 | | |
|---|
| 6277 | | namespace test_lambda_init_capture |
|---|
| 6278 | | { |
|---|
| 6279 | | |
|---|
| 6280 | | int |
|---|
| 6281 | | test() |
|---|
| 6282 | | { |
|---|
| 6283 | | auto x = 0; |
|---|
| 6284 | | const auto lambda1 = [a = x](int b){ return a + b; }; |
|---|
| 6285 | | const auto lambda2 = [a = lambda1(x)](){ return a; }; |
|---|
| 6286 | | return lambda2(); |
|---|
| 6287 | | } |
|---|
| 6288 | | |
|---|
| 6289 | | } |
|---|
| 6290 | | |
|---|
| 6291 | | namespace test_digit_separators |
|---|
| 6292 | | { |
|---|
| 6293 | | |
|---|
| 6294 | | constexpr auto ten_million = 100'000'000; |
|---|
| 6295 | | static_assert(ten_million == 100000000, ""); |
|---|
| 6296 | | |
|---|
| 6297 | | } |
|---|
| 6298 | | |
|---|
| 6299 | | namespace test_return_type_deduction |
|---|
| 6300 | | { |
|---|
| 6301 | | |
|---|
| 6302 | | auto f(int& x) { return x; } |
|---|
| 6303 | | decltype(auto) g(int& x) { return x; } |
|---|
| 6304 | | |
|---|
| 6305 | | template < typename T1, typename T2 > |
|---|
| 6306 | | struct is_same |
|---|
| 6307 | | { |
|---|
| 6308 | | static constexpr auto value = false; |
|---|
| 6309 | | }; |
|---|
| 6310 | | |
|---|
| 6311 | | template < typename T > |
|---|
| 6312 | | struct is_same<T, T> |
|---|
| 6313 | | { |
|---|
| 6314 | | static constexpr auto value = true; |
|---|
| 6315 | | }; |
|---|
| 6316 | | |
|---|
| 6317 | | int |
|---|
| 6318 | | test() |
|---|
| 6319 | | { |
|---|
| 6320 | | auto x = 0; |
|---|
| 6321 | | static_assert(is_same<int, decltype(f(x))>::value, ""); |
|---|
| 6322 | | static_assert(is_same<int&, decltype(g(x))>::value, ""); |
|---|
| 6323 | | return x; |
|---|
| 6324 | | } |
|---|
| 6325 | | |
|---|
| 6326 | | } |
|---|
| 6327 | | |
|---|
| 6328 | | } // namespace cxx14 |
|---|
| 6329 | | |
|---|
| 6330 | | #endif // __cplusplus >= 201402L |
|---|
| 6331 | | |
|---|
| 6332 | | |
|---|
| 6333 | | |
|---|
| 6334 | | |
|---|
| 6335 | | // If the compiler admits that it is not ready for C++17, why torture it? |
|---|
| 6336 | | // Hopefully, this will speed up the test. |
|---|
| 6337 | | |
|---|
| 6338 | | #ifndef __cplusplus |
|---|
| 6339 | | |
|---|
| 6340 | | #error "This is not a C++ compiler" |
|---|
| 6341 | | |
|---|
| 6342 | | #elif __cplusplus < 201703L |
|---|
| 6343 | | |
|---|
| 6344 | | #error "This is not a C++17 compiler" |
|---|
| 6345 | | |
|---|
| 6346 | | #else |
|---|
| 6347 | | |
|---|
| 6348 | | #include <initializer_list> |
|---|
| 6349 | | #include <utility> |
|---|
| 6350 | | #include <type_traits> |
|---|
| 6351 | | |
|---|
| 6352 | | namespace cxx17 |
|---|
| 6353 | | { |
|---|
| 6354 | | |
|---|
| 6355 | | namespace test_constexpr_lambdas |
|---|
| 6356 | | { |
|---|
| 6357 | | |
|---|
| 6358 | | constexpr int foo = [](){return 42;}(); |
|---|
| 6359 | | |
|---|
| 6360 | | } |
|---|
| 6361 | | |
|---|
| 6362 | | namespace test::nested_namespace::definitions |
|---|
| 6363 | | { |
|---|
| 6364 | | |
|---|
| 6365 | | } |
|---|
| 6366 | | |
|---|
| 6367 | | namespace test_fold_expression |
|---|
| 6368 | | { |
|---|
| 6369 | | |
|---|
| 6370 | | template<typename... Args> |
|---|
| 6371 | | int multiply(Args... args) |
|---|
| 6372 | | { |
|---|
| 6373 | | return (args * ... * 1); |
|---|
| 6374 | | } |
|---|
| 6375 | | |
|---|
| 6376 | | template<typename... Args> |
|---|
| 6377 | | bool all(Args... args) |
|---|
| 6378 | | { |
|---|
| 6379 | | return (args && ...); |
|---|
| 6380 | | } |
|---|
| 6381 | | |
|---|
| 6382 | | } |
|---|
| 6383 | | |
|---|
| 6384 | | namespace test_extended_static_assert |
|---|
| 6385 | | { |
|---|
| 6386 | | |
|---|
| 6387 | | static_assert (true); |
|---|
| 6388 | | |
|---|
| 6389 | | } |
|---|
| 6390 | | |
|---|
| 6391 | | namespace test_auto_brace_init_list |
|---|
| 6392 | | { |
|---|
| 6393 | | |
|---|
| 6394 | | auto foo = {5}; |
|---|
| 6395 | | auto bar {5}; |
|---|
| 6396 | | |
|---|
| 6397 | | static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
|---|
| 6398 | | static_assert(std::is_same<int, decltype(bar)>::value); |
|---|
| 6399 | | } |
|---|
| 6400 | | |
|---|
| 6401 | | namespace test_typename_in_template_template_parameter |
|---|
| 6402 | | { |
|---|
| 6403 | | |
|---|
| 6404 | | template<template<typename> typename X> struct D; |
|---|
| 6405 | | |
|---|
| 6406 | | } |
|---|
| 6407 | | |
|---|
| 6408 | | namespace test_fallthrough_nodiscard_maybe_unused_attributes |
|---|
| 6409 | | { |
|---|
| 6410 | | |
|---|
| 6411 | | int f1() |
|---|
| 6412 | | { |
|---|
| 6413 | | return 42; |
|---|
| 6414 | | } |
|---|
| 6415 | | |
|---|
| 6416 | | [[nodiscard]] int f2() |
|---|
| 6417 | | { |
|---|
| 6418 | | [[maybe_unused]] auto unused = f1(); |
|---|
| 6419 | | |
|---|
| 6420 | | switch (f1()) |
|---|
| 6421 | | { |
|---|
| 6422 | | case 17: |
|---|
| 6423 | | f1(); |
|---|
| 6424 | | [[fallthrough]]; |
|---|
| 6425 | | case 42: |
|---|
| 6426 | | f1(); |
|---|
| 6427 | | } |
|---|
| 6428 | | return f1(); |
|---|
| 6429 | | } |
|---|
| 6430 | | |
|---|
| 6431 | | } |
|---|
| 6432 | | |
|---|
| 6433 | | namespace test_extended_aggregate_initialization |
|---|
| 6434 | | { |
|---|
| 6435 | | |
|---|
| 6436 | | struct base1 |
|---|
| 6437 | | { |
|---|
| 6438 | | int b1, b2 = 42; |
|---|
| 6439 | | }; |
|---|
| 6440 | | |
|---|
| 6441 | | struct base2 |
|---|
| 6442 | | { |
|---|
| 6443 | | base2() { |
|---|
| 6444 | | b3 = 42; |
|---|
| 6445 | | } |
|---|
| 6446 | | int b3; |
|---|
| 6447 | | }; |
|---|
| 6448 | | |
|---|
| 6449 | | struct derived : base1, base2 |
|---|
| 6450 | | { |
|---|
| 6451 | | int d; |
|---|
| 6452 | | }; |
|---|
| 6453 | | |
|---|
| 6454 | | derived d1 {{1, 2}, {}, 4}; // full initialization |
|---|
| 6455 | | derived d2 {{}, {}, 4}; // value-initialized bases |
|---|
| 6456 | | |
|---|
| 6457 | | } |
|---|
| 6458 | | |
|---|
| 6459 | | namespace test_general_range_based_for_loop |
|---|
| 6460 | | { |
|---|
| 6461 | | |
|---|
| 6462 | | struct iter |
|---|
| 6463 | | { |
|---|
| 6464 | | int i; |
|---|
| 6465 | | |
|---|
| 6466 | | int& operator* () |
|---|
| 6467 | | { |
|---|
| 6468 | | return i; |
|---|
| 6469 | | } |
|---|
| 6470 | | |
|---|
| 6471 | | const int& operator* () const |
|---|
| 6472 | | { |
|---|
| 6473 | | return i; |
|---|
| 6474 | | } |
|---|
| 6475 | | |
|---|
| 6476 | | iter& operator++() |
|---|
| 6477 | | { |
|---|
| 6478 | | ++i; |
|---|
| 6479 | | return *this; |
|---|
| 6480 | | } |
|---|
| 6481 | | }; |
|---|
| 6482 | | |
|---|
| 6483 | | struct sentinel |
|---|
| 6484 | | { |
|---|
| 6485 | | int i; |
|---|
| 6486 | | }; |
|---|
| 6487 | | |
|---|
| 6488 | | bool operator== (const iter& i, const sentinel& s) |
|---|
| 6489 | | { |
|---|
| 6490 | | return i.i == s.i; |
|---|
| 6491 | | } |
|---|
| 6492 | | |
|---|
| 6493 | | bool operator!= (const iter& i, const sentinel& s) |
|---|
| 6494 | | { |
|---|
| 6495 | | return !(i == s); |
|---|
| 6496 | | } |
|---|
| 6497 | | |
|---|
| 6498 | | struct range |
|---|
| 6499 | | { |
|---|
| 6500 | | iter begin() const |
|---|
| 6501 | | { |
|---|
| 6502 | | return {0}; |
|---|
| 6503 | | } |
|---|
| 6504 | | |
|---|
| 6505 | | sentinel end() const |
|---|
| 6506 | | { |
|---|
| 6507 | | return {5}; |
|---|
| 6508 | | } |
|---|
| 6509 | | }; |
|---|
| 6510 | | |
|---|
| 6511 | | void f() |
|---|
| 6512 | | { |
|---|
| 6513 | | range r {}; |
|---|
| 6514 | | |
|---|
| 6515 | | for (auto i : r) |
|---|
| 6516 | | { |
|---|
| 6517 | | [[maybe_unused]] auto v = i; |
|---|
| 6518 | | } |
|---|
| 6519 | | } |
|---|
| 6520 | | |
|---|
| 6521 | | } |
|---|
| 6522 | | |
|---|
| 6523 | | namespace test_lambda_capture_asterisk_this_by_value |
|---|
| 6524 | | { |
|---|
| 6525 | | |
|---|
| 6526 | | struct t |
|---|
| 6527 | | { |
|---|
| 6528 | | int i; |
|---|
| 6529 | | int foo() |
|---|
| 6530 | | { |
|---|
| 6531 | | return [*this]() |
|---|
| 6532 | | { |
|---|
| 6533 | | return i; |
|---|
| 6534 | | }(); |
|---|
| 6535 | | } |
|---|
| 6536 | | }; |
|---|
| 6537 | | |
|---|
| 6538 | | } |
|---|
| 6539 | | |
|---|
| 6540 | | namespace test_enum_class_construction |
|---|
| 6541 | | { |
|---|
| 6542 | | |
|---|
| 6543 | | enum class byte : unsigned char |
|---|
| 6544 | | {}; |
|---|
| 6545 | | |
|---|
| 6546 | | byte foo {42}; |
|---|
| 6547 | | |
|---|
| 6548 | | } |
|---|
| 6549 | | |
|---|
| 6550 | | namespace test_constexpr_if |
|---|
| 6551 | | { |
|---|
| 6552 | | |
|---|
| 6553 | | template <bool cond> |
|---|
| 6554 | | int f () |
|---|
| 6555 | | { |
|---|
| 6556 | | if constexpr(cond) |
|---|
| 6557 | | { |
|---|
| 6558 | | return 13; |
|---|
| 6559 | | } |
|---|
| 6560 | | else |
|---|
| 6561 | | { |
|---|
| 6562 | | return 42; |
|---|
| 6563 | | } |
|---|
| 6564 | | } |
|---|
| 6565 | | |
|---|
| 6566 | | } |
|---|
| 6567 | | |
|---|
| 6568 | | namespace test_selection_statement_with_initializer |
|---|
| 6569 | | { |
|---|
| 6570 | | |
|---|
| 6571 | | int f() |
|---|
| 6572 | | { |
|---|
| 6573 | | return 13; |
|---|
| 6574 | | } |
|---|
| 6575 | | |
|---|
| 6576 | | int f2() |
|---|
| 6577 | | { |
|---|
| 6578 | | if (auto i = f(); i > 0) |
|---|
| 6579 | | { |
|---|
| 6580 | | return 3; |
|---|
| 6581 | | } |
|---|
| 6582 | | |
|---|
| 6583 | | switch (auto i = f(); i + 4) |
|---|
| 6584 | | { |
|---|
| 6585 | | case 17: |
|---|
| 6586 | | return 2; |
|---|
| 6587 | | |
|---|
| 6588 | | default: |
|---|
| 6589 | | return 1; |
|---|
| 6590 | | } |
|---|
| 6591 | | } |
|---|
| 6592 | | |
|---|
| 6593 | | } |
|---|
| 6594 | | |
|---|
| 6595 | | namespace test_template_argument_deduction_for_class_templates |
|---|
| 6596 | | { |
|---|
| 6597 | | |
|---|
| 6598 | | template <typename T1, typename T2> |
|---|
| 6599 | | struct pair |
|---|
| 6600 | | { |
|---|
| 6601 | | pair (T1 p1, T2 p2) |
|---|
| 6602 | | : m1 {p1}, |
|---|
| 6603 | | m2 {p2} |
|---|
| 6604 | | {} |
|---|
| 6605 | | |
|---|
| 6606 | | T1 m1; |
|---|
| 6607 | | T2 m2; |
|---|
| 6608 | | }; |
|---|
| 6609 | | |
|---|
| 6610 | | void f() |
|---|
| 6611 | | { |
|---|
| 6612 | | [[maybe_unused]] auto p = pair{13, 42u}; |
|---|
| 6613 | | } |
|---|
| 6614 | | |
|---|
| 6615 | | } |
|---|
| 6616 | | |
|---|
| 6617 | | namespace test_non_type_auto_template_parameters |
|---|
| 6618 | | { |
|---|
| 6619 | | |
|---|
| 6620 | | template <auto n> |
|---|
| 6621 | | struct B |
|---|
| 6622 | | {}; |
|---|
| 6623 | | |
|---|
| 6624 | | B<5> b1; |
|---|
| 6625 | | B<'a'> b2; |
|---|
| 6626 | | |
|---|
| 6627 | | } |
|---|
| 6628 | | |
|---|
| 6629 | | namespace test_structured_bindings |
|---|
| 6630 | | { |
|---|
| 6631 | | |
|---|
| 6632 | | int arr[2] = { 1, 2 }; |
|---|
| 6633 | | std::pair<int, int> pr = { 1, 2 }; |
|---|
| 6634 | | |
|---|
| 6635 | | auto f1() -> int(&)[2] |
|---|
| 6636 | | { |
|---|
| 6637 | | return arr; |
|---|
| 6638 | | } |
|---|
| 6639 | | |
|---|
| 6640 | | auto f2() -> std::pair<int, int>& |
|---|
| 6641 | | { |
|---|
| 6642 | | return pr; |
|---|
| 6643 | | } |
|---|
| 6644 | | |
|---|
| 6645 | | struct S |
|---|
| 6646 | | { |
|---|
| 6647 | | int x1 : 2; |
|---|
| 6648 | | volatile double y1; |
|---|
| 6649 | | }; |
|---|
| 6650 | | |
|---|
| 6651 | | S f3() |
|---|
| 6652 | | { |
|---|
| 6653 | | return {}; |
|---|
| 6654 | | } |
|---|
| 6655 | | |
|---|
| 6656 | | auto [ x1, y1 ] = f1(); |
|---|
| 6657 | | auto& [ xr1, yr1 ] = f1(); |
|---|
| 6658 | | auto [ x2, y2 ] = f2(); |
|---|
| 6659 | | auto& [ xr2, yr2 ] = f2(); |
|---|
| 6660 | | const auto [ x3, y3 ] = f3(); |
|---|
| 6661 | | |
|---|
| 6662 | | } |
|---|
| 6663 | | |
|---|
| 6664 | | namespace test_exception_spec_type_system |
|---|
| 6665 | | { |
|---|
| 6666 | | |
|---|
| 6667 | | struct Good {}; |
|---|
| 6668 | | struct Bad {}; |
|---|
| 6669 | | |
|---|
| 6670 | | void g1() noexcept; |
|---|
| 6671 | | void g2(); |
|---|
| 6672 | | |
|---|
| 6673 | | template<typename T> |
|---|
| 6674 | | Bad |
|---|
| 6675 | | f(T*, T*); |
|---|
| 6676 | | |
|---|
| 6677 | | template<typename T1, typename T2> |
|---|
| 6678 | | Good |
|---|
| 6679 | | f(T1*, T2*); |
|---|
| 6680 | | |
|---|
| 6681 | | static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
|---|
| 6682 | | |
|---|
| 6683 | | } |
|---|
| 6684 | | |
|---|
| 6685 | | namespace test_inline_variables |
|---|
| 6686 | | { |
|---|
| 6687 | | |
|---|
| 6688 | | template<class T> void f(T) |
|---|
| 6689 | | {} |
|---|
| 6690 | | |
|---|
| 6691 | | template<class T> inline T g(T) |
|---|
| 6692 | | { |
|---|
| 6693 | | return T{}; |
|---|
| 6694 | | } |
|---|
| 6695 | | |
|---|
| 6696 | | template<> inline void f<>(int) |
|---|
| 6697 | | {} |
|---|
| 6698 | | |
|---|
| 6699 | | template<> int g<>(int) |
|---|
| 6700 | | { |
|---|
| 6701 | | return 5; |
|---|
| 6702 | | } |
|---|
| 6703 | | |
|---|
| 6704 | | } |
|---|
| 6705 | | |
|---|
| 6706 | | } // namespace cxx17 |
|---|
| 6707 | | |
|---|
| 6708 | | #endif // __cplusplus < 201703L |
|---|
| 6709 | | |
|---|
| 6710 | | |
|---|
| 6711 | | |
|---|
| 6712 | configure:21015: result: no |
|---|
| 6713 | configure:20206: checking whether /usr/bin/clang++ supports C++17 features with -h std=c++1z |
|---|
| 6714 | configure:21003: /usr/bin/clang++ -h std=c++1z -c -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk conftest.cpp >&5 |
|---|
| 6715 | clang++: error: unknown argument: '-h' |
|---|
| 6716 | clang++: error: no such file or directory: 'std=c++1z'; did you mean '-std=c++1z'? |
|---|
| 6717 | configure:21003: $? = 1 |
|---|
| 6718 | configure: failed program was: |
|---|
| 6719 | | /* confdefs.h */ |
|---|
| 6720 | | #define PACKAGE_NAME "graphviz" |
|---|
| 6721 | | #define PACKAGE_TARNAME "graphviz" |
|---|
| 6722 | | #define PACKAGE_VERSION "12.2.1" |
|---|
| 6723 | | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 6724 | | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 6725 | | #define PACKAGE_URL "" |
|---|
| 6726 | | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 6727 | | #define GVPLUGIN_VERSION 6 |
|---|
| 6728 | | #define DARWIN 1 |
|---|
| 6729 | | #define DARWIN_DYLIB "" |
|---|
| 6730 | | #define DEFAULT_DPI 96 |
|---|
| 6731 | | #define BROWSER "open" |
|---|
| 6732 | | #define YYTEXT_POINTER 1 |
|---|
| 6733 | | #define HAVE_STDIO_H 1 |
|---|
| 6734 | | #define HAVE_STDLIB_H 1 |
|---|
| 6735 | | #define HAVE_STRING_H 1 |
|---|
| 6736 | | #define HAVE_INTTYPES_H 1 |
|---|
| 6737 | | #define HAVE_STDINT_H 1 |
|---|
| 6738 | | #define HAVE_STRINGS_H 1 |
|---|
| 6739 | | #define HAVE_SYS_STAT_H 1 |
|---|
| 6740 | | #define HAVE_SYS_TYPES_H 1 |
|---|
| 6741 | | #define HAVE_UNISTD_H 1 |
|---|
| 6742 | | #define STDC_HEADERS 1 |
|---|
| 6743 | | #define HAVE_DLFCN_H 1 |
|---|
| 6744 | | #define LT_OBJDIR ".libs/" |
|---|
| 6745 | | /* end confdefs.h. */ |
|---|
| 6746 | | |
|---|
| 6747 | | |
|---|
| 6748 | | // If the compiler admits that it is not ready for C++11, why torture it? |
|---|
| 6749 | | // Hopefully, this will speed up the test. |
|---|
| 6750 | | |
|---|
| 6751 | | #ifndef __cplusplus |
|---|
| 6752 | | |
|---|
| 6753 | | #error "This is not a C++ compiler" |
|---|
| 6754 | | |
|---|
| 6755 | | #elif __cplusplus < 201103L |
|---|
| 6756 | | |
|---|
| 6757 | | #error "This is not a C++11 compiler" |
|---|
| 6758 | | |
|---|
| 6759 | | #else |
|---|
| 6760 | | |
|---|
| 6761 | | namespace cxx11 |
|---|
| 6762 | | { |
|---|
| 6763 | | |
|---|
| 6764 | | namespace test_static_assert |
|---|
| 6765 | | { |
|---|
| 6766 | | |
|---|
| 6767 | | template <typename T> |
|---|
| 6768 | | struct check |
|---|
| 6769 | | { |
|---|
| 6770 | | static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
|---|
| 6771 | | }; |
|---|
| 6772 | | |
|---|
| 6773 | | } |
|---|
| 6774 | | |
|---|
| 6775 | | namespace test_final_override |
|---|
| 6776 | | { |
|---|
| 6777 | | |
|---|
| 6778 | | struct Base |
|---|
| 6779 | | { |
|---|
| 6780 | | virtual ~Base() {} |
|---|
| 6781 | | virtual void f() {} |
|---|
| 6782 | | }; |
|---|
| 6783 | | |
|---|
| 6784 | | struct Derived : public Base |
|---|
| 6785 | | { |
|---|
| 6786 | | virtual ~Derived() override {} |
|---|
| 6787 | | virtual void f() override {} |
|---|
| 6788 | | }; |
|---|
| 6789 | | |
|---|
| 6790 | | } |
|---|
| 6791 | | |
|---|
| 6792 | | namespace test_double_right_angle_brackets |
|---|
| 6793 | | { |
|---|
| 6794 | | |
|---|
| 6795 | | template < typename T > |
|---|
| 6796 | | struct check {}; |
|---|
| 6797 | | |
|---|
| 6798 | | typedef check<void> single_type; |
|---|
| 6799 | | typedef check<check<void>> double_type; |
|---|
| 6800 | | typedef check<check<check<void>>> triple_type; |
|---|
| 6801 | | typedef check<check<check<check<void>>>> quadruple_type; |
|---|
| 6802 | | |
|---|
| 6803 | | } |
|---|
| 6804 | | |
|---|
| 6805 | | namespace test_decltype |
|---|
| 6806 | | { |
|---|
| 6807 | | |
|---|
| 6808 | | int |
|---|
| 6809 | | f() |
|---|
| 6810 | | { |
|---|
| 6811 | | int a = 1; |
|---|
| 6812 | | decltype(a) b = 2; |
|---|
| 6813 | | return a + b; |
|---|
| 6814 | | } |
|---|
| 6815 | | |
|---|
| 6816 | | } |
|---|
| 6817 | | |
|---|
| 6818 | | namespace test_type_deduction |
|---|
| 6819 | | { |
|---|
| 6820 | | |
|---|
| 6821 | | template < typename T1, typename T2 > |
|---|
| 6822 | | struct is_same |
|---|
| 6823 | | { |
|---|
| 6824 | | static const bool value = false; |
|---|
| 6825 | | }; |
|---|
| 6826 | | |
|---|
| 6827 | | template < typename T > |
|---|
| 6828 | | struct is_same<T, T> |
|---|
| 6829 | | { |
|---|
| 6830 | | static const bool value = true; |
|---|
| 6831 | | }; |
|---|
| 6832 | | |
|---|
| 6833 | | template < typename T1, typename T2 > |
|---|
| 6834 | | auto |
|---|
| 6835 | | add(T1 a1, T2 a2) -> decltype(a1 + a2) |
|---|
| 6836 | | { |
|---|
| 6837 | | return a1 + a2; |
|---|
| 6838 | | } |
|---|
| 6839 | | |
|---|
| 6840 | | int |
|---|
| 6841 | | test(const int c, volatile int v) |
|---|
| 6842 | | { |
|---|
| 6843 | | static_assert(is_same<int, decltype(0)>::value == true, ""); |
|---|
| 6844 | | static_assert(is_same<int, decltype(c)>::value == false, ""); |
|---|
| 6845 | | static_assert(is_same<int, decltype(v)>::value == false, ""); |
|---|
| 6846 | | auto ac = c; |
|---|
| 6847 | | auto av = v; |
|---|
| 6848 | | auto sumi = ac + av + 'x'; |
|---|
| 6849 | | auto sumf = ac + av + 1.0; |
|---|
| 6850 | | static_assert(is_same<int, decltype(ac)>::value == true, ""); |
|---|
| 6851 | | static_assert(is_same<int, decltype(av)>::value == true, ""); |
|---|
| 6852 | | static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
|---|
| 6853 | | static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
|---|
| 6854 | | static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
|---|
| 6855 | | return (sumf > 0.0) ? sumi : add(c, v); |
|---|
| 6856 | | } |
|---|
| 6857 | | |
|---|
| 6858 | | } |
|---|
| 6859 | | |
|---|
| 6860 | | namespace test_noexcept |
|---|
| 6861 | | { |
|---|
| 6862 | | |
|---|
| 6863 | | int f() { return 0; } |
|---|
| 6864 | | int g() noexcept { return 0; } |
|---|
| 6865 | | |
|---|
| 6866 | | static_assert(noexcept(f()) == false, ""); |
|---|
| 6867 | | static_assert(noexcept(g()) == true, ""); |
|---|
| 6868 | | |
|---|
| 6869 | | } |
|---|
| 6870 | | |
|---|
| 6871 | | namespace test_constexpr |
|---|
| 6872 | | { |
|---|
| 6873 | | |
|---|
| 6874 | | template < typename CharT > |
|---|
| 6875 | | unsigned long constexpr |
|---|
| 6876 | | strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
|---|
| 6877 | | { |
|---|
| 6878 | | return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
|---|
| 6879 | | } |
|---|
| 6880 | | |
|---|
| 6881 | | template < typename CharT > |
|---|
| 6882 | | unsigned long constexpr |
|---|
| 6883 | | strlen_c(const CharT *const s) noexcept |
|---|
| 6884 | | { |
|---|
| 6885 | | return strlen_c_r(s, 0UL); |
|---|
| 6886 | | } |
|---|
| 6887 | | |
|---|
| 6888 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 6889 | | static_assert(strlen_c("1") == 1UL, ""); |
|---|
| 6890 | | static_assert(strlen_c("example") == 7UL, ""); |
|---|
| 6891 | | static_assert(strlen_c("another\0example") == 7UL, ""); |
|---|
| 6892 | | |
|---|
| 6893 | | } |
|---|
| 6894 | | |
|---|
| 6895 | | namespace test_rvalue_references |
|---|
| 6896 | | { |
|---|
| 6897 | | |
|---|
| 6898 | | template < int N > |
|---|
| 6899 | | struct answer |
|---|
| 6900 | | { |
|---|
| 6901 | | static constexpr int value = N; |
|---|
| 6902 | | }; |
|---|
| 6903 | | |
|---|
| 6904 | | answer<1> f(int&) { return answer<1>(); } |
|---|
| 6905 | | answer<2> f(const int&) { return answer<2>(); } |
|---|
| 6906 | | answer<3> f(int&&) { return answer<3>(); } |
|---|
| 6907 | | |
|---|
| 6908 | | void |
|---|
| 6909 | | test() |
|---|
| 6910 | | { |
|---|
| 6911 | | int i = 0; |
|---|
| 6912 | | const int c = 0; |
|---|
| 6913 | | static_assert(decltype(f(i))::value == 1, ""); |
|---|
| 6914 | | static_assert(decltype(f(c))::value == 2, ""); |
|---|
| 6915 | | static_assert(decltype(f(0))::value == 3, ""); |
|---|
| 6916 | | } |
|---|
| 6917 | | |
|---|
| 6918 | | } |
|---|
| 6919 | | |
|---|
| 6920 | | namespace test_uniform_initialization |
|---|
| 6921 | | { |
|---|
| 6922 | | |
|---|
| 6923 | | struct test |
|---|
| 6924 | | { |
|---|
| 6925 | | static const int zero {}; |
|---|
| 6926 | | static const int one {1}; |
|---|
| 6927 | | }; |
|---|
| 6928 | | |
|---|
| 6929 | | static_assert(test::zero == 0, ""); |
|---|
| 6930 | | static_assert(test::one == 1, ""); |
|---|
| 6931 | | |
|---|
| 6932 | | } |
|---|
| 6933 | | |
|---|
| 6934 | | namespace test_lambdas |
|---|
| 6935 | | { |
|---|
| 6936 | | |
|---|
| 6937 | | void |
|---|
| 6938 | | test1() |
|---|
| 6939 | | { |
|---|
| 6940 | | auto lambda1 = [](){}; |
|---|
| 6941 | | auto lambda2 = lambda1; |
|---|
| 6942 | | lambda1(); |
|---|
| 6943 | | lambda2(); |
|---|
| 6944 | | } |
|---|
| 6945 | | |
|---|
| 6946 | | int |
|---|
| 6947 | | test2() |
|---|
| 6948 | | { |
|---|
| 6949 | | auto a = [](int i, int j){ return i + j; }(1, 2); |
|---|
| 6950 | | auto b = []() -> int { return '0'; }(); |
|---|
| 6951 | | auto c = [=](){ return a + b; }(); |
|---|
| 6952 | | auto d = [&](){ return c; }(); |
|---|
| 6953 | | auto e = [a, &b](int x) mutable { |
|---|
| 6954 | | const auto identity = [](int y){ return y; }; |
|---|
| 6955 | | for (auto i = 0; i < a; ++i) |
|---|
| 6956 | | a += b--; |
|---|
| 6957 | | return x + identity(a + b); |
|---|
| 6958 | | }(0); |
|---|
| 6959 | | return a + b + c + d + e; |
|---|
| 6960 | | } |
|---|
| 6961 | | |
|---|
| 6962 | | int |
|---|
| 6963 | | test3() |
|---|
| 6964 | | { |
|---|
| 6965 | | const auto nullary = [](){ return 0; }; |
|---|
| 6966 | | const auto unary = [](int x){ return x; }; |
|---|
| 6967 | | using nullary_t = decltype(nullary); |
|---|
| 6968 | | using unary_t = decltype(unary); |
|---|
| 6969 | | const auto higher1st = [](nullary_t f){ return f(); }; |
|---|
| 6970 | | const auto higher2nd = [unary](nullary_t f1){ |
|---|
| 6971 | | return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
|---|
| 6972 | | }; |
|---|
| 6973 | | return higher1st(nullary) + higher2nd(nullary)(unary); |
|---|
| 6974 | | } |
|---|
| 6975 | | |
|---|
| 6976 | | } |
|---|
| 6977 | | |
|---|
| 6978 | | namespace test_variadic_templates |
|---|
| 6979 | | { |
|---|
| 6980 | | |
|---|
| 6981 | | template <int...> |
|---|
| 6982 | | struct sum; |
|---|
| 6983 | | |
|---|
| 6984 | | template <int N0, int... N1toN> |
|---|
| 6985 | | struct sum<N0, N1toN...> |
|---|
| 6986 | | { |
|---|
| 6987 | | static constexpr auto value = N0 + sum<N1toN...>::value; |
|---|
| 6988 | | }; |
|---|
| 6989 | | |
|---|
| 6990 | | template <> |
|---|
| 6991 | | struct sum<> |
|---|
| 6992 | | { |
|---|
| 6993 | | static constexpr auto value = 0; |
|---|
| 6994 | | }; |
|---|
| 6995 | | |
|---|
| 6996 | | static_assert(sum<>::value == 0, ""); |
|---|
| 6997 | | static_assert(sum<1>::value == 1, ""); |
|---|
| 6998 | | static_assert(sum<23>::value == 23, ""); |
|---|
| 6999 | | static_assert(sum<1, 2>::value == 3, ""); |
|---|
| 7000 | | static_assert(sum<5, 5, 11>::value == 21, ""); |
|---|
| 7001 | | static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
|---|
| 7002 | | |
|---|
| 7003 | | } |
|---|
| 7004 | | |
|---|
| 7005 | | // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
|---|
| 7006 | | // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
|---|
| 7007 | | // because of this. |
|---|
| 7008 | | namespace test_template_alias_sfinae |
|---|
| 7009 | | { |
|---|
| 7010 | | |
|---|
| 7011 | | struct foo {}; |
|---|
| 7012 | | |
|---|
| 7013 | | template<typename T> |
|---|
| 7014 | | using member = typename T::member_type; |
|---|
| 7015 | | |
|---|
| 7016 | | template<typename T> |
|---|
| 7017 | | void func(...) {} |
|---|
| 7018 | | |
|---|
| 7019 | | template<typename T> |
|---|
| 7020 | | void func(member<T>*) {} |
|---|
| 7021 | | |
|---|
| 7022 | | void test(); |
|---|
| 7023 | | |
|---|
| 7024 | | void test() { func<foo>(0); } |
|---|
| 7025 | | |
|---|
| 7026 | | } |
|---|
| 7027 | | |
|---|
| 7028 | | } // namespace cxx11 |
|---|
| 7029 | | |
|---|
| 7030 | | #endif // __cplusplus >= 201103L |
|---|
| 7031 | | |
|---|
| 7032 | | |
|---|
| 7033 | | |
|---|
| 7034 | | |
|---|
| 7035 | | // If the compiler admits that it is not ready for C++14, why torture it? |
|---|
| 7036 | | // Hopefully, this will speed up the test. |
|---|
| 7037 | | |
|---|
| 7038 | | #ifndef __cplusplus |
|---|
| 7039 | | |
|---|
| 7040 | | #error "This is not a C++ compiler" |
|---|
| 7041 | | |
|---|
| 7042 | | #elif __cplusplus < 201402L |
|---|
| 7043 | | |
|---|
| 7044 | | #error "This is not a C++14 compiler" |
|---|
| 7045 | | |
|---|
| 7046 | | #else |
|---|
| 7047 | | |
|---|
| 7048 | | namespace cxx14 |
|---|
| 7049 | | { |
|---|
| 7050 | | |
|---|
| 7051 | | namespace test_polymorphic_lambdas |
|---|
| 7052 | | { |
|---|
| 7053 | | |
|---|
| 7054 | | int |
|---|
| 7055 | | test() |
|---|
| 7056 | | { |
|---|
| 7057 | | const auto lambda = [](auto&&... args){ |
|---|
| 7058 | | const auto istiny = [](auto x){ |
|---|
| 7059 | | return (sizeof(x) == 1UL) ? 1 : 0; |
|---|
| 7060 | | }; |
|---|
| 7061 | | const int aretiny[] = { istiny(args)... }; |
|---|
| 7062 | | return aretiny[0]; |
|---|
| 7063 | | }; |
|---|
| 7064 | | return lambda(1, 1L, 1.0f, '1'); |
|---|
| 7065 | | } |
|---|
| 7066 | | |
|---|
| 7067 | | } |
|---|
| 7068 | | |
|---|
| 7069 | | namespace test_binary_literals |
|---|
| 7070 | | { |
|---|
| 7071 | | |
|---|
| 7072 | | constexpr auto ivii = 0b0000000000101010; |
|---|
| 7073 | | static_assert(ivii == 42, "wrong value"); |
|---|
| 7074 | | |
|---|
| 7075 | | } |
|---|
| 7076 | | |
|---|
| 7077 | | namespace test_generalized_constexpr |
|---|
| 7078 | | { |
|---|
| 7079 | | |
|---|
| 7080 | | template < typename CharT > |
|---|
| 7081 | | constexpr unsigned long |
|---|
| 7082 | | strlen_c(const CharT *const s) noexcept |
|---|
| 7083 | | { |
|---|
| 7084 | | auto length = 0UL; |
|---|
| 7085 | | for (auto p = s; *p; ++p) |
|---|
| 7086 | | ++length; |
|---|
| 7087 | | return length; |
|---|
| 7088 | | } |
|---|
| 7089 | | |
|---|
| 7090 | | static_assert(strlen_c("") == 0UL, ""); |
|---|
| 7091 | | static_assert(strlen_c("x") == 1UL, ""); |
|---|
| 7092 | | static_assert(strlen_c("test") == 4UL, ""); |
|---|
| 7093 | | static_assert(strlen_c("another\0test") == 7UL, ""); |
|---|
| 7094 | | |
|---|
| 7095 | | } |
|---|
| 7096 | | |
|---|
| 7097 | | namespace test_lambda_init_capture |
|---|
| 7098 | | { |
|---|
| 7099 | | |
|---|
| 7100 | | int |
|---|
| 7101 | | test() |
|---|
| 7102 | | { |
|---|
| 7103 | | auto x = 0; |
|---|
| 7104 | | const auto lambda1 = [a = x](int b){ return a + b; }; |
|---|
| 7105 | | const auto lambda2 = [a = lambda1(x)](){ return a; }; |
|---|
| 7106 | | return lambda2(); |
|---|
| 7107 | | } |
|---|
| 7108 | | |
|---|
| 7109 | | } |
|---|
| 7110 | | |
|---|
| 7111 | | namespace test_digit_separators |
|---|
| 7112 | | { |
|---|
| 7113 | | |
|---|
| 7114 | | constexpr auto ten_million = 100'000'000; |
|---|
| 7115 | | static_assert(ten_million == 100000000, ""); |
|---|
| 7116 | | |
|---|
| 7117 | | } |
|---|
| 7118 | | |
|---|
| 7119 | | namespace test_return_type_deduction |
|---|
| 7120 | | { |
|---|
| 7121 | | |
|---|
| 7122 | | auto f(int& x) { return x; } |
|---|
| 7123 | | decltype(auto) g(int& x) { return x; } |
|---|
| 7124 | | |
|---|
| 7125 | | template < typename T1, typename T2 > |
|---|
| 7126 | | struct is_same |
|---|
| 7127 | | { |
|---|
| 7128 | | static constexpr auto value = false; |
|---|
| 7129 | | }; |
|---|
| 7130 | | |
|---|
| 7131 | | template < typename T > |
|---|
| 7132 | | struct is_same<T, T> |
|---|
| 7133 | | { |
|---|
| 7134 | | static constexpr auto value = true; |
|---|
| 7135 | | }; |
|---|
| 7136 | | |
|---|
| 7137 | | int |
|---|
| 7138 | | test() |
|---|
| 7139 | | { |
|---|
| 7140 | | auto x = 0; |
|---|
| 7141 | | static_assert(is_same<int, decltype(f(x))>::value, ""); |
|---|
| 7142 | | static_assert(is_same<int&, decltype(g(x))>::value, ""); |
|---|
| 7143 | | return x; |
|---|
| 7144 | | } |
|---|
| 7145 | | |
|---|
| 7146 | | } |
|---|
| 7147 | | |
|---|
| 7148 | | } // namespace cxx14 |
|---|
| 7149 | | |
|---|
| 7150 | | #endif // __cplusplus >= 201402L |
|---|
| 7151 | | |
|---|
| 7152 | | |
|---|
| 7153 | | |
|---|
| 7154 | | |
|---|
| 7155 | | // If the compiler admits that it is not ready for C++17, why torture it? |
|---|
| 7156 | | // Hopefully, this will speed up the test. |
|---|
| 7157 | | |
|---|
| 7158 | | #ifndef __cplusplus |
|---|
| 7159 | | |
|---|
| 7160 | | #error "This is not a C++ compiler" |
|---|
| 7161 | | |
|---|
| 7162 | | #elif __cplusplus < 201703L |
|---|
| 7163 | | |
|---|
| 7164 | | #error "This is not a C++17 compiler" |
|---|
| 7165 | | |
|---|
| 7166 | | #else |
|---|
| 7167 | | |
|---|
| 7168 | | #include <initializer_list> |
|---|
| 7169 | | #include <utility> |
|---|
| 7170 | | #include <type_traits> |
|---|
| 7171 | | |
|---|
| 7172 | | namespace cxx17 |
|---|
| 7173 | | { |
|---|
| 7174 | | |
|---|
| 7175 | | namespace test_constexpr_lambdas |
|---|
| 7176 | | { |
|---|
| 7177 | | |
|---|
| 7178 | | constexpr int foo = [](){return 42;}(); |
|---|
| 7179 | | |
|---|
| 7180 | | } |
|---|
| 7181 | | |
|---|
| 7182 | | namespace test::nested_namespace::definitions |
|---|
| 7183 | | { |
|---|
| 7184 | | |
|---|
| 7185 | | } |
|---|
| 7186 | | |
|---|
| 7187 | | namespace test_fold_expression |
|---|
| 7188 | | { |
|---|
| 7189 | | |
|---|
| 7190 | | template<typename... Args> |
|---|
| 7191 | | int multiply(Args... args) |
|---|
| 7192 | | { |
|---|
| 7193 | | return (args * ... * 1); |
|---|
| 7194 | | } |
|---|
| 7195 | | |
|---|
| 7196 | | template<typename... Args> |
|---|
| 7197 | | bool all(Args... args) |
|---|
| 7198 | | { |
|---|
| 7199 | | return (args && ...); |
|---|
| 7200 | | } |
|---|
| 7201 | | |
|---|
| 7202 | | } |
|---|
| 7203 | | |
|---|
| 7204 | | namespace test_extended_static_assert |
|---|
| 7205 | | { |
|---|
| 7206 | | |
|---|
| 7207 | | static_assert (true); |
|---|
| 7208 | | |
|---|
| 7209 | | } |
|---|
| 7210 | | |
|---|
| 7211 | | namespace test_auto_brace_init_list |
|---|
| 7212 | | { |
|---|
| 7213 | | |
|---|
| 7214 | | auto foo = {5}; |
|---|
| 7215 | | auto bar {5}; |
|---|
| 7216 | | |
|---|
| 7217 | | static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
|---|
| 7218 | | static_assert(std::is_same<int, decltype(bar)>::value); |
|---|
| 7219 | | } |
|---|
| 7220 | | |
|---|
| 7221 | | namespace test_typename_in_template_template_parameter |
|---|
| 7222 | | { |
|---|
| 7223 | | |
|---|
| 7224 | | template<template<typename> typename X> struct D; |
|---|
| 7225 | | |
|---|
| 7226 | | } |
|---|
| 7227 | | |
|---|
| 7228 | | namespace test_fallthrough_nodiscard_maybe_unused_attributes |
|---|
| 7229 | | { |
|---|
| 7230 | | |
|---|
| 7231 | | int f1() |
|---|
| 7232 | | { |
|---|
| 7233 | | return 42; |
|---|
| 7234 | | } |
|---|
| 7235 | | |
|---|
| 7236 | | [[nodiscard]] int f2() |
|---|
| 7237 | | { |
|---|
| 7238 | | [[maybe_unused]] auto unused = f1(); |
|---|
| 7239 | | |
|---|
| 7240 | | switch (f1()) |
|---|
| 7241 | | { |
|---|
| 7242 | | case 17: |
|---|
| 7243 | | f1(); |
|---|
| 7244 | | [[fallthrough]]; |
|---|
| 7245 | | case 42: |
|---|
| 7246 | | f1(); |
|---|
| 7247 | | } |
|---|
| 7248 | | return f1(); |
|---|
| 7249 | | } |
|---|
| 7250 | | |
|---|
| 7251 | | } |
|---|
| 7252 | | |
|---|
| 7253 | | namespace test_extended_aggregate_initialization |
|---|
| 7254 | | { |
|---|
| 7255 | | |
|---|
| 7256 | | struct base1 |
|---|
| 7257 | | { |
|---|
| 7258 | | int b1, b2 = 42; |
|---|
| 7259 | | }; |
|---|
| 7260 | | |
|---|
| 7261 | | struct base2 |
|---|
| 7262 | | { |
|---|
| 7263 | | base2() { |
|---|
| 7264 | | b3 = 42; |
|---|
| 7265 | | } |
|---|
| 7266 | | int b3; |
|---|
| 7267 | | }; |
|---|
| 7268 | | |
|---|
| 7269 | | struct derived : base1, base2 |
|---|
| 7270 | | { |
|---|
| 7271 | | int d; |
|---|
| 7272 | | }; |
|---|
| 7273 | | |
|---|
| 7274 | | derived d1 {{1, 2}, {}, 4}; // full initialization |
|---|
| 7275 | | derived d2 {{}, {}, 4}; // value-initialized bases |
|---|
| 7276 | | |
|---|
| 7277 | | } |
|---|
| 7278 | | |
|---|
| 7279 | | namespace test_general_range_based_for_loop |
|---|
| 7280 | | { |
|---|
| 7281 | | |
|---|
| 7282 | | struct iter |
|---|
| 7283 | | { |
|---|
| 7284 | | int i; |
|---|
| 7285 | | |
|---|
| 7286 | | int& operator* () |
|---|
| 7287 | | { |
|---|
| 7288 | | return i; |
|---|
| 7289 | | } |
|---|
| 7290 | | |
|---|
| 7291 | | const int& operator* () const |
|---|
| 7292 | | { |
|---|
| 7293 | | return i; |
|---|
| 7294 | | } |
|---|
| 7295 | | |
|---|
| 7296 | | iter& operator++() |
|---|
| 7297 | | { |
|---|
| 7298 | | ++i; |
|---|
| 7299 | | return *this; |
|---|
| 7300 | | } |
|---|
| 7301 | | }; |
|---|
| 7302 | | |
|---|
| 7303 | | struct sentinel |
|---|
| 7304 | | { |
|---|
| 7305 | | int i; |
|---|
| 7306 | | }; |
|---|
| 7307 | | |
|---|
| 7308 | | bool operator== (const iter& i, const sentinel& s) |
|---|
| 7309 | | { |
|---|
| 7310 | | return i.i == s.i; |
|---|
| 7311 | | } |
|---|
| 7312 | | |
|---|
| 7313 | | bool operator!= (const iter& i, const sentinel& s) |
|---|
| 7314 | | { |
|---|
| 7315 | | return !(i == s); |
|---|
| 7316 | | } |
|---|
| 7317 | | |
|---|
| 7318 | | struct range |
|---|
| 7319 | | { |
|---|
| 7320 | | iter begin() const |
|---|
| 7321 | | { |
|---|
| 7322 | | return {0}; |
|---|
| 7323 | | } |
|---|
| 7324 | | |
|---|
| 7325 | | sentinel end() const |
|---|
| 7326 | | { |
|---|
| 7327 | | return {5}; |
|---|
| 7328 | | } |
|---|
| 7329 | | }; |
|---|
| 7330 | | |
|---|
| 7331 | | void f() |
|---|
| 7332 | | { |
|---|
| 7333 | | range r {}; |
|---|
| 7334 | | |
|---|
| 7335 | | for (auto i : r) |
|---|
| 7336 | | { |
|---|
| 7337 | | [[maybe_unused]] auto v = i; |
|---|
| 7338 | | } |
|---|
| 7339 | | } |
|---|
| 7340 | | |
|---|
| 7341 | | } |
|---|
| 7342 | | |
|---|
| 7343 | | namespace test_lambda_capture_asterisk_this_by_value |
|---|
| 7344 | | { |
|---|
| 7345 | | |
|---|
| 7346 | | struct t |
|---|
| 7347 | | { |
|---|
| 7348 | | int i; |
|---|
| 7349 | | int foo() |
|---|
| 7350 | | { |
|---|
| 7351 | | return [*this]() |
|---|
| 7352 | | { |
|---|
| 7353 | | return i; |
|---|
| 7354 | | }(); |
|---|
| 7355 | | } |
|---|
| 7356 | | }; |
|---|
| 7357 | | |
|---|
| 7358 | | } |
|---|
| 7359 | | |
|---|
| 7360 | | namespace test_enum_class_construction |
|---|
| 7361 | | { |
|---|
| 7362 | | |
|---|
| 7363 | | enum class byte : unsigned char |
|---|
| 7364 | | {}; |
|---|
| 7365 | | |
|---|
| 7366 | | byte foo {42}; |
|---|
| 7367 | | |
|---|
| 7368 | | } |
|---|
| 7369 | | |
|---|
| 7370 | | namespace test_constexpr_if |
|---|
| 7371 | | { |
|---|
| 7372 | | |
|---|
| 7373 | | template <bool cond> |
|---|
| 7374 | | int f () |
|---|
| 7375 | | { |
|---|
| 7376 | | if constexpr(cond) |
|---|
| 7377 | | { |
|---|
| 7378 | | return 13; |
|---|
| 7379 | | } |
|---|
| 7380 | | else |
|---|
| 7381 | | { |
|---|
| 7382 | | return 42; |
|---|
| 7383 | | } |
|---|
| 7384 | | } |
|---|
| 7385 | | |
|---|
| 7386 | | } |
|---|
| 7387 | | |
|---|
| 7388 | | namespace test_selection_statement_with_initializer |
|---|
| 7389 | | { |
|---|
| 7390 | | |
|---|
| 7391 | | int f() |
|---|
| 7392 | | { |
|---|
| 7393 | | return 13; |
|---|
| 7394 | | } |
|---|
| 7395 | | |
|---|
| 7396 | | int f2() |
|---|
| 7397 | | { |
|---|
| 7398 | | if (auto i = f(); i > 0) |
|---|
| 7399 | | { |
|---|
| 7400 | | return 3; |
|---|
| 7401 | | } |
|---|
| 7402 | | |
|---|
| 7403 | | switch (auto i = f(); i + 4) |
|---|
| 7404 | | { |
|---|
| 7405 | | case 17: |
|---|
| 7406 | | return 2; |
|---|
| 7407 | | |
|---|
| 7408 | | default: |
|---|
| 7409 | | return 1; |
|---|
| 7410 | | } |
|---|
| 7411 | | } |
|---|
| 7412 | | |
|---|
| 7413 | | } |
|---|
| 7414 | | |
|---|
| 7415 | | namespace test_template_argument_deduction_for_class_templates |
|---|
| 7416 | | { |
|---|
| 7417 | | |
|---|
| 7418 | | template <typename T1, typename T2> |
|---|
| 7419 | | struct pair |
|---|
| 7420 | | { |
|---|
| 7421 | | pair (T1 p1, T2 p2) |
|---|
| 7422 | | : m1 {p1}, |
|---|
| 7423 | | m2 {p2} |
|---|
| 7424 | | {} |
|---|
| 7425 | | |
|---|
| 7426 | | T1 m1; |
|---|
| 7427 | | T2 m2; |
|---|
| 7428 | | }; |
|---|
| 7429 | | |
|---|
| 7430 | | void f() |
|---|
| 7431 | | { |
|---|
| 7432 | | [[maybe_unused]] auto p = pair{13, 42u}; |
|---|
| 7433 | | } |
|---|
| 7434 | | |
|---|
| 7435 | | } |
|---|
| 7436 | | |
|---|
| 7437 | | namespace test_non_type_auto_template_parameters |
|---|
| 7438 | | { |
|---|
| 7439 | | |
|---|
| 7440 | | template <auto n> |
|---|
| 7441 | | struct B |
|---|
| 7442 | | {}; |
|---|
| 7443 | | |
|---|
| 7444 | | B<5> b1; |
|---|
| 7445 | | B<'a'> b2; |
|---|
| 7446 | | |
|---|
| 7447 | | } |
|---|
| 7448 | | |
|---|
| 7449 | | namespace test_structured_bindings |
|---|
| 7450 | | { |
|---|
| 7451 | | |
|---|
| 7452 | | int arr[2] = { 1, 2 }; |
|---|
| 7453 | | std::pair<int, int> pr = { 1, 2 }; |
|---|
| 7454 | | |
|---|
| 7455 | | auto f1() -> int(&)[2] |
|---|
| 7456 | | { |
|---|
| 7457 | | return arr; |
|---|
| 7458 | | } |
|---|
| 7459 | | |
|---|
| 7460 | | auto f2() -> std::pair<int, int>& |
|---|
| 7461 | | { |
|---|
| 7462 | | return pr; |
|---|
| 7463 | | } |
|---|
| 7464 | | |
|---|
| 7465 | | struct S |
|---|
| 7466 | | { |
|---|
| 7467 | | int x1 : 2; |
|---|
| 7468 | | volatile double y1; |
|---|
| 7469 | | }; |
|---|
| 7470 | | |
|---|
| 7471 | | S f3() |
|---|
| 7472 | | { |
|---|
| 7473 | | return {}; |
|---|
| 7474 | | } |
|---|
| 7475 | | |
|---|
| 7476 | | auto [ x1, y1 ] = f1(); |
|---|
| 7477 | | auto& [ xr1, yr1 ] = f1(); |
|---|
| 7478 | | auto [ x2, y2 ] = f2(); |
|---|
| 7479 | | auto& [ xr2, yr2 ] = f2(); |
|---|
| 7480 | | const auto [ x3, y3 ] = f3(); |
|---|
| 7481 | | |
|---|
| 7482 | | } |
|---|
| 7483 | | |
|---|
| 7484 | | namespace test_exception_spec_type_system |
|---|
| 7485 | | { |
|---|
| 7486 | | |
|---|
| 7487 | | struct Good {}; |
|---|
| 7488 | | struct Bad {}; |
|---|
| 7489 | | |
|---|
| 7490 | | void g1() noexcept; |
|---|
| 7491 | | void g2(); |
|---|
| 7492 | | |
|---|
| 7493 | | template<typename T> |
|---|
| 7494 | | Bad |
|---|
| 7495 | | f(T*, T*); |
|---|
| 7496 | | |
|---|
| 7497 | | template<typename T1, typename T2> |
|---|
| 7498 | | Good |
|---|
| 7499 | | f(T1*, T2*); |
|---|
| 7500 | | |
|---|
| 7501 | | static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
|---|
| 7502 | | |
|---|
| 7503 | | } |
|---|
| 7504 | | |
|---|
| 7505 | | namespace test_inline_variables |
|---|
| 7506 | | { |
|---|
| 7507 | | |
|---|
| 7508 | | template<class T> void f(T) |
|---|
| 7509 | | {} |
|---|
| 7510 | | |
|---|
| 7511 | | template<class T> inline T g(T) |
|---|
| 7512 | | { |
|---|
| 7513 | | return T{}; |
|---|
| 7514 | | } |
|---|
| 7515 | | |
|---|
| 7516 | | template<> inline void f<>(int) |
|---|
| 7517 | | {} |
|---|
| 7518 | | |
|---|
| 7519 | | template<> int g<>(int) |
|---|
| 7520 | | { |
|---|
| 7521 | | return 5; |
|---|
| 7522 | | } |
|---|
| 7523 | | |
|---|
| 7524 | | } |
|---|
| 7525 | | |
|---|
| 7526 | | } // namespace cxx17 |
|---|
| 7527 | | |
|---|
| 7528 | | #endif // __cplusplus < 201703L |
|---|
| 7529 | | |
|---|
| 7530 | | |
|---|
| 7531 | | |
|---|
| 7532 | configure:21015: result: no |
|---|
| 7533 | configure:21039: error: *** A compiler with support for C++17 language features is required. |
|---|
| 7534 | |
|---|
| 7535 | ## ---------------- ## |
|---|
| 7536 | ## Cache variables. ## |
|---|
| 7537 | ## ---------------- ## |
|---|
| 7538 | |
|---|
| 7539 | ac_cv_build=aarch64-apple-darwin24.3.0 |
|---|
| 7540 | ac_cv_c_compiler_gnu=yes |
|---|
| 7541 | ac_cv_cxx_compiler_gnu=yes |
|---|
| 7542 | ac_cv_env_ANN_CFLAGS_set= |
|---|
| 7543 | ac_cv_env_ANN_CFLAGS_value= |
|---|
| 7544 | ac_cv_env_ANN_LIBS_set= |
|---|
| 7545 | ac_cv_env_ANN_LIBS_value= |
|---|
| 7546 | ac_cv_env_CCC_set= |
|---|
| 7547 | ac_cv_env_CCC_value= |
|---|
| 7548 | ac_cv_env_CC_set=set |
|---|
| 7549 | ac_cv_env_CC_value=/usr/bin/clang |
|---|
| 7550 | ac_cv_env_CFLAGS_set=set |
|---|
| 7551 | ac_cv_env_CFLAGS_value='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7552 | ac_cv_env_CPPFLAGS_set=set |
|---|
| 7553 | ac_cv_env_CPPFLAGS_value='-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk' |
|---|
| 7554 | ac_cv_env_CPP_set= |
|---|
| 7555 | ac_cv_env_CPP_value= |
|---|
| 7556 | ac_cv_env_CXXCPP_set= |
|---|
| 7557 | ac_cv_env_CXXCPP_value= |
|---|
| 7558 | ac_cv_env_CXXFLAGS_set=set |
|---|
| 7559 | ac_cv_env_CXXFLAGS_value='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7560 | ac_cv_env_CXX_set=set |
|---|
| 7561 | ac_cv_env_CXX_value=/usr/bin/clang++ |
|---|
| 7562 | ac_cv_env_EXPAT_CFLAGS_set= |
|---|
| 7563 | ac_cv_env_EXPAT_CFLAGS_value= |
|---|
| 7564 | ac_cv_env_EXPAT_LIBS_set= |
|---|
| 7565 | ac_cv_env_EXPAT_LIBS_value= |
|---|
| 7566 | ac_cv_env_FREETYPE2_CFLAGS_set= |
|---|
| 7567 | ac_cv_env_FREETYPE2_CFLAGS_value= |
|---|
| 7568 | ac_cv_env_FREETYPE2_LIBS_set= |
|---|
| 7569 | ac_cv_env_FREETYPE2_LIBS_value= |
|---|
| 7570 | ac_cv_env_GDK_CFLAGS_set= |
|---|
| 7571 | ac_cv_env_GDK_CFLAGS_value= |
|---|
| 7572 | ac_cv_env_GDK_LIBS_set= |
|---|
| 7573 | ac_cv_env_GDK_LIBS_value= |
|---|
| 7574 | ac_cv_env_GDK_PIXBUF_CFLAGS_set= |
|---|
| 7575 | ac_cv_env_GDK_PIXBUF_CFLAGS_value= |
|---|
| 7576 | ac_cv_env_GDK_PIXBUF_LIBS_set= |
|---|
| 7577 | ac_cv_env_GDK_PIXBUF_LIBS_value= |
|---|
| 7578 | ac_cv_env_GDLIB_CFLAGS_set= |
|---|
| 7579 | ac_cv_env_GDLIB_CFLAGS_value= |
|---|
| 7580 | ac_cv_env_GDLIB_LIBS_set= |
|---|
| 7581 | ac_cv_env_GDLIB_LIBS_value= |
|---|
| 7582 | ac_cv_env_GLADE_CFLAGS_set= |
|---|
| 7583 | ac_cv_env_GLADE_CFLAGS_value= |
|---|
| 7584 | ac_cv_env_GLADE_LIBS_set= |
|---|
| 7585 | ac_cv_env_GLADE_LIBS_value= |
|---|
| 7586 | ac_cv_env_GTKGLEXT_CFLAGS_set= |
|---|
| 7587 | ac_cv_env_GTKGLEXT_CFLAGS_value= |
|---|
| 7588 | ac_cv_env_GTKGLEXT_LIBS_set= |
|---|
| 7589 | ac_cv_env_GTKGLEXT_LIBS_value= |
|---|
| 7590 | ac_cv_env_GTKGL_CFLAGS_set= |
|---|
| 7591 | ac_cv_env_GTKGL_CFLAGS_value= |
|---|
| 7592 | ac_cv_env_GTKGL_LIBS_set= |
|---|
| 7593 | ac_cv_env_GTKGL_LIBS_value= |
|---|
| 7594 | ac_cv_env_GTK_CFLAGS_set= |
|---|
| 7595 | ac_cv_env_GTK_CFLAGS_value= |
|---|
| 7596 | ac_cv_env_GTK_LIBS_set= |
|---|
| 7597 | ac_cv_env_GTK_LIBS_value= |
|---|
| 7598 | ac_cv_env_GTS_CFLAGS_set= |
|---|
| 7599 | ac_cv_env_GTS_CFLAGS_value= |
|---|
| 7600 | ac_cv_env_GTS_LIBS_set= |
|---|
| 7601 | ac_cv_env_GTS_LIBS_value= |
|---|
| 7602 | ac_cv_env_GUILE_CFLAGS_set= |
|---|
| 7603 | ac_cv_env_GUILE_CFLAGS_value= |
|---|
| 7604 | ac_cv_env_GUILE_LIBS_set= |
|---|
| 7605 | ac_cv_env_GUILE_LIBS_value= |
|---|
| 7606 | ac_cv_env_INTGOSIZE_set= |
|---|
| 7607 | ac_cv_env_INTGOSIZE_value= |
|---|
| 7608 | ac_cv_env_LASI_CFLAGS_set= |
|---|
| 7609 | ac_cv_env_LASI_CFLAGS_value= |
|---|
| 7610 | ac_cv_env_LASI_LIBS_set= |
|---|
| 7611 | ac_cv_env_LASI_LIBS_value= |
|---|
| 7612 | ac_cv_env_LDFLAGS_set=set |
|---|
| 7613 | ac_cv_env_LDFLAGS_value='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7614 | ac_cv_env_LIBPOSTFIX_set= |
|---|
| 7615 | ac_cv_env_LIBPOSTFIX_value= |
|---|
| 7616 | ac_cv_env_LIBS_set= |
|---|
| 7617 | ac_cv_env_LIBS_value= |
|---|
| 7618 | ac_cv_env_LT_SYS_LIBRARY_PATH_set= |
|---|
| 7619 | ac_cv_env_LT_SYS_LIBRARY_PATH_value= |
|---|
| 7620 | ac_cv_env_OBJCFLAGS_set=set |
|---|
| 7621 | ac_cv_env_OBJCFLAGS_value='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7622 | ac_cv_env_OBJC_set=set |
|---|
| 7623 | ac_cv_env_OBJC_value=/usr/bin/clang |
|---|
| 7624 | ac_cv_env_PANGOCAIRO_CFLAGS_set= |
|---|
| 7625 | ac_cv_env_PANGOCAIRO_CFLAGS_value= |
|---|
| 7626 | ac_cv_env_PANGOCAIRO_LIBS_set= |
|---|
| 7627 | ac_cv_env_PANGOCAIRO_LIBS_value= |
|---|
| 7628 | ac_cv_env_PANGOFT2_CFLAGS_set= |
|---|
| 7629 | ac_cv_env_PANGOFT2_CFLAGS_value= |
|---|
| 7630 | ac_cv_env_PANGOFT2_LIBS_set= |
|---|
| 7631 | ac_cv_env_PANGOFT2_LIBS_value= |
|---|
| 7632 | ac_cv_env_PKG_CONFIG_LIBDIR_set= |
|---|
| 7633 | ac_cv_env_PKG_CONFIG_LIBDIR_value= |
|---|
| 7634 | ac_cv_env_PKG_CONFIG_PATH_set= |
|---|
| 7635 | ac_cv_env_PKG_CONFIG_PATH_value= |
|---|
| 7636 | ac_cv_env_PKG_CONFIG_set= |
|---|
| 7637 | ac_cv_env_PKG_CONFIG_value= |
|---|
| 7638 | ac_cv_env_POPPLER_CFLAGS_set= |
|---|
| 7639 | ac_cv_env_POPPLER_CFLAGS_value= |
|---|
| 7640 | ac_cv_env_POPPLER_LIBS_set= |
|---|
| 7641 | ac_cv_env_POPPLER_LIBS_value= |
|---|
| 7642 | ac_cv_env_QTCORE_CFLAGS_set= |
|---|
| 7643 | ac_cv_env_QTCORE_CFLAGS_value= |
|---|
| 7644 | ac_cv_env_QTCORE_LIBS_set= |
|---|
| 7645 | ac_cv_env_QTCORE_LIBS_value= |
|---|
| 7646 | ac_cv_env_QTGUI_CFLAGS_set= |
|---|
| 7647 | ac_cv_env_QTGUI_CFLAGS_value= |
|---|
| 7648 | ac_cv_env_QTGUI_LIBS_set= |
|---|
| 7649 | ac_cv_env_QTGUI_LIBS_value= |
|---|
| 7650 | ac_cv_env_RSVG_CFLAGS_set= |
|---|
| 7651 | ac_cv_env_RSVG_CFLAGS_value= |
|---|
| 7652 | ac_cv_env_RSVG_LIBS_set= |
|---|
| 7653 | ac_cv_env_RSVG_LIBS_value= |
|---|
| 7654 | ac_cv_env_RUBY_CFLAGS_set= |
|---|
| 7655 | ac_cv_env_RUBY_CFLAGS_value= |
|---|
| 7656 | ac_cv_env_RUBY_LIBS_set= |
|---|
| 7657 | ac_cv_env_RUBY_LIBS_value= |
|---|
| 7658 | ac_cv_env_RUBY_VER_set= |
|---|
| 7659 | ac_cv_env_RUBY_VER_value= |
|---|
| 7660 | ac_cv_env_R_CFLAGS_set= |
|---|
| 7661 | ac_cv_env_R_CFLAGS_value= |
|---|
| 7662 | ac_cv_env_R_LIBS_set= |
|---|
| 7663 | ac_cv_env_R_LIBS_value= |
|---|
| 7664 | ac_cv_env_WEBP_CFLAGS_set= |
|---|
| 7665 | ac_cv_env_WEBP_CFLAGS_value= |
|---|
| 7666 | ac_cv_env_WEBP_LIBS_set= |
|---|
| 7667 | ac_cv_env_WEBP_LIBS_value= |
|---|
| 7668 | ac_cv_env_XMKMF_set= |
|---|
| 7669 | ac_cv_env_XMKMF_value= |
|---|
| 7670 | ac_cv_env_XRENDER_CFLAGS_set= |
|---|
| 7671 | ac_cv_env_XRENDER_CFLAGS_value= |
|---|
| 7672 | ac_cv_env_XRENDER_LIBS_set= |
|---|
| 7673 | ac_cv_env_XRENDER_LIBS_value= |
|---|
| 7674 | ac_cv_env_YACC_set= |
|---|
| 7675 | ac_cv_env_YACC_value= |
|---|
| 7676 | ac_cv_env_YFLAGS_set= |
|---|
| 7677 | ac_cv_env_YFLAGS_value= |
|---|
| 7678 | ac_cv_env_build_alias_set= |
|---|
| 7679 | ac_cv_env_build_alias_value= |
|---|
| 7680 | ac_cv_env_host_alias_set= |
|---|
| 7681 | ac_cv_env_host_alias_value= |
|---|
| 7682 | ac_cv_env_target_alias_set= |
|---|
| 7683 | ac_cv_env_target_alias_value= |
|---|
| 7684 | ac_cv_header_dlfcn_h=yes |
|---|
| 7685 | ac_cv_header_inttypes_h=yes |
|---|
| 7686 | ac_cv_header_stdint_h=yes |
|---|
| 7687 | ac_cv_header_stdio_h=yes |
|---|
| 7688 | ac_cv_header_stdlib_h=yes |
|---|
| 7689 | ac_cv_header_string_h=yes |
|---|
| 7690 | ac_cv_header_strings_h=yes |
|---|
| 7691 | ac_cv_header_sys_stat_h=yes |
|---|
| 7692 | ac_cv_header_sys_types_h=yes |
|---|
| 7693 | ac_cv_header_unistd_h=yes |
|---|
| 7694 | ac_cv_host=aarch64-apple-darwin24.3.0 |
|---|
| 7695 | ac_cv_lib_lex='none needed' |
|---|
| 7696 | ac_cv_objext=o |
|---|
| 7697 | ac_cv_path_EGREP='/usr/bin/grep -E' |
|---|
| 7698 | ac_cv_path_EGREP_TRADITIONAL='/usr/bin/grep -E' |
|---|
| 7699 | ac_cv_path_FGREP='/usr/bin/grep -F' |
|---|
| 7700 | ac_cv_path_GREP=/usr/bin/grep |
|---|
| 7701 | ac_cv_path_SED=/usr/bin/sed |
|---|
| 7702 | ac_cv_path_TCLSH=/usr/bin/tclsh8.5 |
|---|
| 7703 | ac_cv_path_ac_pt_PKG_CONFIG=/opt/local/bin/pkg-config |
|---|
| 7704 | ac_cv_path_lt_DD=/bin/dd |
|---|
| 7705 | ac_cv_path_mkdir=/opt/local/bin/gmkdir |
|---|
| 7706 | ac_cv_prog_AWK=/usr/bin/awk |
|---|
| 7707 | ac_cv_prog_CXXCPP='/usr/bin/clang++ -E' |
|---|
| 7708 | ac_cv_prog_FILECMD=file |
|---|
| 7709 | ac_cv_prog_LEX=flex |
|---|
| 7710 | ac_cv_prog_YACC='bison -y' |
|---|
| 7711 | ac_cv_prog_ac_ct_AR=ar |
|---|
| 7712 | ac_cv_prog_ac_ct_CC=/usr/bin/clang |
|---|
| 7713 | ac_cv_prog_ac_ct_DSYMUTIL=dsymutil |
|---|
| 7714 | ac_cv_prog_ac_ct_LIPO=lipo |
|---|
| 7715 | ac_cv_prog_ac_ct_NMEDIT=nmedit |
|---|
| 7716 | ac_cv_prog_ac_ct_OBJDUMP=objdump |
|---|
| 7717 | ac_cv_prog_ac_ct_OTOOL=otool |
|---|
| 7718 | ac_cv_prog_ac_ct_RANLIB=ranlib |
|---|
| 7719 | ac_cv_prog_ac_ct_STRIP=strip |
|---|
| 7720 | ac_cv_prog_cc_c11= |
|---|
| 7721 | ac_cv_prog_cc_g=yes |
|---|
| 7722 | ac_cv_prog_cc_stdc= |
|---|
| 7723 | ac_cv_prog_cxx_cxx11=no |
|---|
| 7724 | ac_cv_prog_cxx_cxx98=no |
|---|
| 7725 | ac_cv_prog_cxx_g=yes |
|---|
| 7726 | ac_cv_prog_lex_root=lex.yy |
|---|
| 7727 | ac_cv_prog_lex_yytext_pointer=yes |
|---|
| 7728 | ac_cv_prog_make_make_set=yes |
|---|
| 7729 | ac_cv_search_yywrap=-lfl |
|---|
| 7730 | am_cv_CC_dependencies_compiler_type=gcc3 |
|---|
| 7731 | am_cv_CXX_dependencies_compiler_type=gcc3 |
|---|
| 7732 | am_cv_filesystem_timestamp_resolution=2 |
|---|
| 7733 | am_cv_make_support_nested_variables=yes |
|---|
| 7734 | am_cv_prog_cc_c_o=yes |
|---|
| 7735 | am_cv_prog_tar_ustar=gnutar |
|---|
| 7736 | am_cv_sleep_fractional_seconds=yes |
|---|
| 7737 | am_cv_xargs_n_works=yes |
|---|
| 7738 | ax_cv_cxx_compile_cxx17__h_std_cpp17=no |
|---|
| 7739 | ax_cv_cxx_compile_cxx17__h_std_cpp1z=no |
|---|
| 7740 | ax_cv_cxx_compile_cxx17__std_cpp17=no |
|---|
| 7741 | ax_cv_cxx_compile_cxx17__std_cpp1z=no |
|---|
| 7742 | ax_cv_cxx_compile_cxx17_pstd_cpp17=no |
|---|
| 7743 | ax_cv_cxx_compile_cxx17_pstd_cpp1z=no |
|---|
| 7744 | lt_cv_apple_cc_single_mod=no |
|---|
| 7745 | lt_cv_ar_at_file=no |
|---|
| 7746 | lt_cv_deplibs_check_method=pass_all |
|---|
| 7747 | lt_cv_file_magic_cmd='$MAGIC_CMD' |
|---|
| 7748 | lt_cv_file_magic_test_file= |
|---|
| 7749 | lt_cv_ld_exported_symbols_list=yes |
|---|
| 7750 | lt_cv_ld_force_load=yes |
|---|
| 7751 | lt_cv_ld_reload_flag=-r |
|---|
| 7752 | lt_cv_nm_interface='BSD nm' |
|---|
| 7753 | lt_cv_objdir=.libs |
|---|
| 7754 | lt_cv_path_LD=/Library/Developer/CommandLineTools/usr/bin/ld |
|---|
| 7755 | lt_cv_path_LDCXX=/Library/Developer/CommandLineTools/usr/bin/ld |
|---|
| 7756 | lt_cv_path_NM='/opt/local/bin/nm -B' |
|---|
| 7757 | lt_cv_path_manifest_tool=no |
|---|
| 7758 | lt_cv_prog_compiler_c_o=yes |
|---|
| 7759 | lt_cv_prog_compiler_c_o_CXX=yes |
|---|
| 7760 | lt_cv_prog_compiler_pic='-fno-common -DPIC' |
|---|
| 7761 | lt_cv_prog_compiler_pic_CXX='-fno-common -DPIC' |
|---|
| 7762 | lt_cv_prog_compiler_pic_works=yes |
|---|
| 7763 | lt_cv_prog_compiler_pic_works_CXX=yes |
|---|
| 7764 | lt_cv_prog_compiler_rtti_exceptions=yes |
|---|
| 7765 | lt_cv_prog_compiler_static_works=no |
|---|
| 7766 | lt_cv_prog_compiler_static_works_CXX=no |
|---|
| 7767 | lt_cv_prog_gnu_ld=no |
|---|
| 7768 | lt_cv_prog_gnu_ldcxx=no |
|---|
| 7769 | lt_cv_sharedlib_from_linklib_cmd='printf %s\n' |
|---|
| 7770 | lt_cv_support_no_fixup_chains=yes |
|---|
| 7771 | lt_cv_sys_global_symbol_pipe='/usr/bin/sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p'\'' | /usr/bin/sed '\''/ __gnu_lto/d'\''' |
|---|
| 7772 | lt_cv_sys_global_symbol_to_c_name_address='/usr/bin/sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\''' |
|---|
| 7773 | lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='/usr/bin/sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\''' |
|---|
| 7774 | lt_cv_sys_global_symbol_to_cdecl='/usr/bin/sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' |
|---|
| 7775 | lt_cv_sys_global_symbol_to_import= |
|---|
| 7776 | lt_cv_sys_max_cmd_len=786432 |
|---|
| 7777 | lt_cv_to_host_file_cmd=func_convert_file_noop |
|---|
| 7778 | lt_cv_to_tool_file_cmd=func_convert_file_noop |
|---|
| 7779 | lt_cv_truncate_bin='/bin/dd bs=4096 count=1' |
|---|
| 7780 | |
|---|
| 7781 | ## ----------------- ## |
|---|
| 7782 | ## Output variables. ## |
|---|
| 7783 | ## ----------------- ## |
|---|
| 7784 | |
|---|
| 7785 | ACLOCAL='${SHELL} '\''/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work/graphviz-12.2.1/config/missing'\'' aclocal-1.17' |
|---|
| 7786 | AMDEPBACKSLASH='\' |
|---|
| 7787 | AMDEP_FALSE='#' |
|---|
| 7788 | AMDEP_TRUE='' |
|---|
| 7789 | AMTAR='$${TAR-tar}' |
|---|
| 7790 | AM_BACKSLASH='\' |
|---|
| 7791 | AM_DEFAULT_V='' |
|---|
| 7792 | AM_DEFAULT_VERBOSITY='0' |
|---|
| 7793 | AM_V='' |
|---|
| 7794 | ANN_CFLAGS='' |
|---|
| 7795 | ANN_LIBS='' |
|---|
| 7796 | AR='ar' |
|---|
| 7797 | AUTOCONF='${SHELL} '\''/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work/graphviz-12.2.1/config/missing'\'' autoconf' |
|---|
| 7798 | AUTOHEADER='${SHELL} '\''/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work/graphviz-12.2.1/config/missing'\'' autoheader' |
|---|
| 7799 | AUTOMAKE='${SHELL} '\''/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work/graphviz-12.2.1/config/missing'\'' automake-1.17' |
|---|
| 7800 | AWK='/usr/bin/awk' |
|---|
| 7801 | CC='/usr/bin/clang' |
|---|
| 7802 | CCDEPMODE='depmode=gcc3' |
|---|
| 7803 | CFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7804 | CONVENIENCE_LTDL_FALSE='' |
|---|
| 7805 | CONVENIENCE_LTDL_TRUE='' |
|---|
| 7806 | CPP='' |
|---|
| 7807 | CPPFLAGS='-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk' |
|---|
| 7808 | CSCOPE='cscope' |
|---|
| 7809 | CTAGS='ctags' |
|---|
| 7810 | CXX='/usr/bin/clang++' |
|---|
| 7811 | CXXCPP='/usr/bin/clang++ -E' |
|---|
| 7812 | CXXDEPMODE='depmode=gcc3' |
|---|
| 7813 | CXXFLAGS='-pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7814 | CYGPATH_W='echo' |
|---|
| 7815 | CYGWIN='no' |
|---|
| 7816 | DARWIN='yes' |
|---|
| 7817 | DEBUG_FALSE='' |
|---|
| 7818 | DEBUG_TRUE='' |
|---|
| 7819 | DEFS='' |
|---|
| 7820 | DEPDIR='.deps' |
|---|
| 7821 | DEVIL_INCLUDES='' |
|---|
| 7822 | DEVIL_LIBS='' |
|---|
| 7823 | DLLTOOL='false' |
|---|
| 7824 | DSYMUTIL='dsymutil' |
|---|
| 7825 | DUMPBIN='' |
|---|
| 7826 | ECHO_C='\c' |
|---|
| 7827 | ECHO_N='' |
|---|
| 7828 | ECHO_T='' |
|---|
| 7829 | EGREP='/usr/bin/grep -E' |
|---|
| 7830 | ENABLE_LTDL_FALSE='' |
|---|
| 7831 | ENABLE_LTDL_TRUE='' |
|---|
| 7832 | ENABLE_MAN_PDFS_FALSE='' |
|---|
| 7833 | ENABLE_MAN_PDFS_TRUE='#' |
|---|
| 7834 | ENABLE_SHARED_FALSE='#' |
|---|
| 7835 | ENABLE_SHARED_TRUE='' |
|---|
| 7836 | ENABLE_STATIC_FALSE='' |
|---|
| 7837 | ENABLE_STATIC_TRUE='#' |
|---|
| 7838 | ETAGS='etags' |
|---|
| 7839 | EXEEXT='' |
|---|
| 7840 | EXPAT_CFLAGS='' |
|---|
| 7841 | EXPAT_LIBS='' |
|---|
| 7842 | FGREP='/usr/bin/grep -F' |
|---|
| 7843 | FILECMD='file' |
|---|
| 7844 | FREETYPE2_CFLAGS='' |
|---|
| 7845 | FREETYPE2_LIBS='' |
|---|
| 7846 | GDIPLUS_CFLAGS='' |
|---|
| 7847 | GDIPLUS_HEADS='' |
|---|
| 7848 | GDIPLUS_LIBS='' |
|---|
| 7849 | GDK_CFLAGS='' |
|---|
| 7850 | GDK_LIBS='' |
|---|
| 7851 | GDK_PIXBUF_CFLAGS='' |
|---|
| 7852 | GDK_PIXBUF_LIBS='' |
|---|
| 7853 | GDLIB_CFLAGS='' |
|---|
| 7854 | GDLIB_CONFIG='' |
|---|
| 7855 | GDLIB_LIBS='' |
|---|
| 7856 | GLADE_CFLAGS='' |
|---|
| 7857 | GLADE_LIBS='' |
|---|
| 7858 | GLUT_CFLAGS='' |
|---|
| 7859 | GLUT_LIBS='' |
|---|
| 7860 | GO='' |
|---|
| 7861 | GO_INCLUDES='' |
|---|
| 7862 | GO_LIBS='' |
|---|
| 7863 | GRAPHVIZ_AUTHOR_EMAIL='' |
|---|
| 7864 | GRAPHVIZ_AUTHOR_NAME='' |
|---|
| 7865 | GRAPHVIZ_CHANGE_DATE='Fri Dec 6 2024' |
|---|
| 7866 | GRAPHVIZ_VERSION_DATE='20241206.2353' |
|---|
| 7867 | GRAPHVIZ_VERSION_MAJOR='12' |
|---|
| 7868 | GRAPHVIZ_VERSION_MICRO='1' |
|---|
| 7869 | GRAPHVIZ_VERSION_MINOR='2' |
|---|
| 7870 | GREP='/usr/bin/grep' |
|---|
| 7871 | GROFF='' |
|---|
| 7872 | GS_CFLAGS='' |
|---|
| 7873 | GS_LIBS='' |
|---|
| 7874 | GTKGLEXT_CFLAGS='' |
|---|
| 7875 | GTKGLEXT_LIBS='' |
|---|
| 7876 | GTKGL_CFLAGS='' |
|---|
| 7877 | GTKGL_LIBS='' |
|---|
| 7878 | GTK_CFLAGS='' |
|---|
| 7879 | GTK_LIBS='' |
|---|
| 7880 | GTS_CFLAGS='' |
|---|
| 7881 | GTS_LIBS='' |
|---|
| 7882 | GUILE_CFLAGS='' |
|---|
| 7883 | GUILE_LIBS='' |
|---|
| 7884 | GVPLUGIN_CONFIG_FILE='config6' |
|---|
| 7885 | GVPLUGIN_VERSION='6' |
|---|
| 7886 | GVPLUGIN_VERSION_INFO='6:0:0' |
|---|
| 7887 | HAVE_CXX17='' |
|---|
| 7888 | INCLTDL='' |
|---|
| 7889 | INSTALL_DATA='${INSTALL} -m 644' |
|---|
| 7890 | INSTALL_DEMOS_FALSE='#' |
|---|
| 7891 | INSTALL_DEMOS_TRUE='' |
|---|
| 7892 | INSTALL_LTDL_FALSE='' |
|---|
| 7893 | INSTALL_LTDL_TRUE='' |
|---|
| 7894 | INSTALL_PROGRAM='${INSTALL}' |
|---|
| 7895 | INSTALL_SCRIPT='${INSTALL}' |
|---|
| 7896 | INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' |
|---|
| 7897 | INTGOSIZE='32' |
|---|
| 7898 | IPSEPCOLA_INCLUDES='' |
|---|
| 7899 | IPSEPCOLA_LIBS='' |
|---|
| 7900 | JAVA='' |
|---|
| 7901 | JAVASCRIPT='' |
|---|
| 7902 | JAVA_INCLUDES='' |
|---|
| 7903 | JAVA_LIBS='' |
|---|
| 7904 | JNI_EXTRA_LDFLAGS='-shrext .jnilib' |
|---|
| 7905 | JSHEXT='jnilib' |
|---|
| 7906 | LASI_CFLAGS='' |
|---|
| 7907 | LASI_LIBS='' |
|---|
| 7908 | LD='/Library/Developer/CommandLineTools/usr/bin/ld' |
|---|
| 7909 | LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7910 | LEX='flex' |
|---|
| 7911 | LEXLIB='-lfl ' |
|---|
| 7912 | LEX_OUTPUT_ROOT='lex.yy' |
|---|
| 7913 | LIBADD_DL='' |
|---|
| 7914 | LIBADD_DLD_LINK='' |
|---|
| 7915 | LIBADD_DLOPEN='' |
|---|
| 7916 | LIBADD_SHL_LOAD='' |
|---|
| 7917 | LIBLTDL='' |
|---|
| 7918 | LIBOBJS='' |
|---|
| 7919 | LIBPOSTFIX='' |
|---|
| 7920 | LIBS='' |
|---|
| 7921 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' |
|---|
| 7922 | LIPO='lipo' |
|---|
| 7923 | LN_S='ln -s' |
|---|
| 7924 | LTARGZH_EXISTS_FALSE='' |
|---|
| 7925 | LTARGZH_EXISTS_TRUE='' |
|---|
| 7926 | LTDLDEPS='' |
|---|
| 7927 | LTDLINCL='' |
|---|
| 7928 | LTDLOPEN='' |
|---|
| 7929 | LTLIBOBJS='' |
|---|
| 7930 | LT_ARGZ_H='' |
|---|
| 7931 | LT_CONFIG_H='' |
|---|
| 7932 | LT_DLLOADERS='' |
|---|
| 7933 | LT_DLPREOPEN='' |
|---|
| 7934 | LT_SYS_LIBRARY_PATH='' |
|---|
| 7935 | LUA='' |
|---|
| 7936 | LUA_INCLUDES='' |
|---|
| 7937 | LUA_INSTALL_DIR='' |
|---|
| 7938 | LUA_LIBS='' |
|---|
| 7939 | MAKEINFO='${SHELL} '\''/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work/graphviz-12.2.1/config/missing'\'' makeinfo' |
|---|
| 7940 | MANIFEST_TOOL=':' |
|---|
| 7941 | MATH_LIBS='' |
|---|
| 7942 | MCS='' |
|---|
| 7943 | MINGW32='no' |
|---|
| 7944 | MKDIR_P='/opt/local/bin/gmkdir -p' |
|---|
| 7945 | NM='/opt/local/bin/nm -B' |
|---|
| 7946 | NMEDIT='nmedit' |
|---|
| 7947 | OBJC='/usr/bin/clang' |
|---|
| 7948 | OBJCDEPMODE='' |
|---|
| 7949 | OBJCFLAGS='-pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64' |
|---|
| 7950 | OBJDUMP='objdump' |
|---|
| 7951 | OBJEXT='o' |
|---|
| 7952 | OTOOL64=':' |
|---|
| 7953 | OTOOL='otool' |
|---|
| 7954 | PACKAGE='graphviz' |
|---|
| 7955 | PACKAGE_BUGREPORT='https://gitlab.com/graphviz/graphviz/-/issues' |
|---|
| 7956 | PACKAGE_NAME='graphviz' |
|---|
| 7957 | PACKAGE_STRING='graphviz 12.2.1' |
|---|
| 7958 | PACKAGE_TARNAME='graphviz' |
|---|
| 7959 | PACKAGE_URL='' |
|---|
| 7960 | PACKAGE_VERSION='12.2.1' |
|---|
| 7961 | PANGOCAIRO_CFLAGS='' |
|---|
| 7962 | PANGOCAIRO_LIBS='' |
|---|
| 7963 | PANGOFT2_CFLAGS='' |
|---|
| 7964 | PANGOFT2_LIBS='' |
|---|
| 7965 | PATH_SEPARATOR=':' |
|---|
| 7966 | PERL='' |
|---|
| 7967 | PERL_INCLUDES='' |
|---|
| 7968 | PERL_INSTALL_DIR='' |
|---|
| 7969 | PERL_LIBS='' |
|---|
| 7970 | PHP='' |
|---|
| 7971 | PHPCONFIG='' |
|---|
| 7972 | PHP_INCLUDES='' |
|---|
| 7973 | PHP_INSTALL_DATADIR='' |
|---|
| 7974 | PHP_INSTALL_DIR='' |
|---|
| 7975 | PHP_LIBS='' |
|---|
| 7976 | PKG_CONFIG='/opt/local/bin/pkg-config' |
|---|
| 7977 | PKG_CONFIG_LIBDIR='' |
|---|
| 7978 | PKG_CONFIG_PATH='' |
|---|
| 7979 | PLATFORMSDKINCLUDE='' |
|---|
| 7980 | PLATFORMSDKLIB='' |
|---|
| 7981 | POPPLER_CFLAGS='' |
|---|
| 7982 | POPPLER_LIBS='' |
|---|
| 7983 | PS2PDF='' |
|---|
| 7984 | PYTHON3='' |
|---|
| 7985 | PYTHON3_INCLUDES='' |
|---|
| 7986 | PYTHON3_INSTALL_DIR='' |
|---|
| 7987 | PYTHON3_LIBS='' |
|---|
| 7988 | QMAKE='' |
|---|
| 7989 | QTCORE_CFLAGS='' |
|---|
| 7990 | QTCORE_LIBS='' |
|---|
| 7991 | QTGUI_CFLAGS='' |
|---|
| 7992 | QTGUI_LIBS='' |
|---|
| 7993 | QUARTZ_CFLAGS='' |
|---|
| 7994 | QUARTZ_LIBS='' |
|---|
| 7995 | RANLIB='ranlib' |
|---|
| 7996 | RSVG_CFLAGS='' |
|---|
| 7997 | RSVG_LIBS='' |
|---|
| 7998 | RUBY='' |
|---|
| 7999 | RUBY_CFLAGS='' |
|---|
| 8000 | RUBY_INSTALL_DIR='' |
|---|
| 8001 | RUBY_LIBS='' |
|---|
| 8002 | RUBY_VER='' |
|---|
| 8003 | R_CFLAGS='' |
|---|
| 8004 | R_LIBS='' |
|---|
| 8005 | SED='/usr/bin/sed' |
|---|
| 8006 | SET_MAKE='' |
|---|
| 8007 | SHARED_LIBRARY_SUFFIX='.dylib' |
|---|
| 8008 | SHELL='/bin/sh' |
|---|
| 8009 | STRIP='strip' |
|---|
| 8010 | SWIG='' |
|---|
| 8011 | SWIGJAVA_CPPFLAGS='' |
|---|
| 8012 | SWIG_PHP_DATA='' |
|---|
| 8013 | SWIG_PHP_DATA_TO_PACKAGE='' |
|---|
| 8014 | SWIG_PHP_OPT='' |
|---|
| 8015 | SWIG_VERSION='' |
|---|
| 8016 | TCLCONFIG='' |
|---|
| 8017 | TCLINT_INCLUDES='' |
|---|
| 8018 | TCLSH='/usr/bin/tclsh8.5' |
|---|
| 8019 | TCLSH_EXEC_PREFIX='' |
|---|
| 8020 | TCL_CFLAGS='' |
|---|
| 8021 | TCL_DEFS='' |
|---|
| 8022 | TCL_INCLUDES='' |
|---|
| 8023 | TCL_INSTALL_DIR='' |
|---|
| 8024 | TCL_LIBS='' |
|---|
| 8025 | TCL_MAJOR_VERSION='' |
|---|
| 8026 | TCL_MINOR_VERSION='' |
|---|
| 8027 | TCL_PATCH_LEVEL='' |
|---|
| 8028 | TCL_PKGINDEX='' |
|---|
| 8029 | TCL_PKGINDEX_GD='' |
|---|
| 8030 | TCL_PKGINDEX_SWIG='' |
|---|
| 8031 | TCL_SHLIB_SUFFIX='' |
|---|
| 8032 | TCL_SRC_DIR='' |
|---|
| 8033 | TCL_STUB_LIB_SPEC='' |
|---|
| 8034 | TCL_VERSION='' |
|---|
| 8035 | VERSION='12.2.1' |
|---|
| 8036 | WEBP_CFLAGS='' |
|---|
| 8037 | WEBP_LIBS='' |
|---|
| 8038 | WITH_ANN_FALSE='' |
|---|
| 8039 | WITH_ANN_TRUE='' |
|---|
| 8040 | WITH_CGRAPH_FALSE='' |
|---|
| 8041 | WITH_CGRAPH_TRUE='' |
|---|
| 8042 | WITH_CYGWIN_FALSE='' |
|---|
| 8043 | WITH_CYGWIN_TRUE='#' |
|---|
| 8044 | WITH_DEVIL_FALSE='' |
|---|
| 8045 | WITH_DEVIL_TRUE='' |
|---|
| 8046 | WITH_D_FALSE='' |
|---|
| 8047 | WITH_D_TRUE='' |
|---|
| 8048 | WITH_GDIPLUS_FALSE='' |
|---|
| 8049 | WITH_GDIPLUS_TRUE='' |
|---|
| 8050 | WITH_GDK_FALSE='' |
|---|
| 8051 | WITH_GDK_PIXBUF_FALSE='' |
|---|
| 8052 | WITH_GDK_PIXBUF_TRUE='' |
|---|
| 8053 | WITH_GDK_TRUE='' |
|---|
| 8054 | WITH_GLADE_FALSE='' |
|---|
| 8055 | WITH_GLADE_TRUE='' |
|---|
| 8056 | WITH_GO_FALSE='' |
|---|
| 8057 | WITH_GO_TRUE='' |
|---|
| 8058 | WITH_GS_FALSE='' |
|---|
| 8059 | WITH_GS_TRUE='' |
|---|
| 8060 | WITH_GTKGLEXT_FALSE='' |
|---|
| 8061 | WITH_GTKGLEXT_TRUE='' |
|---|
| 8062 | WITH_GTKGL_FALSE='' |
|---|
| 8063 | WITH_GTKGL_TRUE='' |
|---|
| 8064 | WITH_GTK_FALSE='' |
|---|
| 8065 | WITH_GTK_TRUE='' |
|---|
| 8066 | WITH_GTS_FALSE='' |
|---|
| 8067 | WITH_GTS_TRUE='' |
|---|
| 8068 | WITH_GUILE_FALSE='' |
|---|
| 8069 | WITH_GUILE_TRUE='' |
|---|
| 8070 | WITH_IPSEPCOLA_FALSE='' |
|---|
| 8071 | WITH_IPSEPCOLA_TRUE='' |
|---|
| 8072 | WITH_JAVASCRIPT_FALSE='' |
|---|
| 8073 | WITH_JAVASCRIPT_TRUE='' |
|---|
| 8074 | WITH_JAVA_FALSE='' |
|---|
| 8075 | WITH_JAVA_TRUE='' |
|---|
| 8076 | WITH_LASI_FALSE='' |
|---|
| 8077 | WITH_LASI_TRUE='' |
|---|
| 8078 | WITH_LIBGD_FALSE='' |
|---|
| 8079 | WITH_LIBGD_TRUE='' |
|---|
| 8080 | WITH_LUA_FALSE='' |
|---|
| 8081 | WITH_LUA_TRUE='' |
|---|
| 8082 | WITH_MINGW_FALSE='' |
|---|
| 8083 | WITH_MINGW_TRUE='#' |
|---|
| 8084 | WITH_ORTHO_FALSE='' |
|---|
| 8085 | WITH_ORTHO_TRUE='' |
|---|
| 8086 | WITH_PANGOCAIRO_FALSE='' |
|---|
| 8087 | WITH_PANGOCAIRO_TRUE='' |
|---|
| 8088 | WITH_PERL_FALSE='' |
|---|
| 8089 | WITH_PERL_TRUE='' |
|---|
| 8090 | WITH_PHP_FALSE='' |
|---|
| 8091 | WITH_PHP_TRUE='' |
|---|
| 8092 | WITH_POPPLER_FALSE='' |
|---|
| 8093 | WITH_POPPLER_TRUE='' |
|---|
| 8094 | WITH_PYTHON3_FALSE='' |
|---|
| 8095 | WITH_PYTHON3_TRUE='' |
|---|
| 8096 | WITH_QT_FALSE='' |
|---|
| 8097 | WITH_QT_TRUE='' |
|---|
| 8098 | WITH_QUARTZ_FALSE='' |
|---|
| 8099 | WITH_QUARTZ_TRUE='' |
|---|
| 8100 | WITH_RSVG_FALSE='' |
|---|
| 8101 | WITH_RSVG_TRUE='' |
|---|
| 8102 | WITH_RUBY_FALSE='' |
|---|
| 8103 | WITH_RUBY_TRUE='' |
|---|
| 8104 | WITH_R_FALSE='' |
|---|
| 8105 | WITH_R_TRUE='' |
|---|
| 8106 | WITH_SFDP_FALSE='' |
|---|
| 8107 | WITH_SFDP_TRUE='' |
|---|
| 8108 | WITH_SHARP_FALSE='' |
|---|
| 8109 | WITH_SHARP_TRUE='' |
|---|
| 8110 | WITH_SMYRNA_FALSE='' |
|---|
| 8111 | WITH_SMYRNA_TRUE='' |
|---|
| 8112 | WITH_SWIG_FALSE='' |
|---|
| 8113 | WITH_SWIG_PHP_DATA_FALSE='' |
|---|
| 8114 | WITH_SWIG_PHP_DATA_TRUE='' |
|---|
| 8115 | WITH_SWIG_TRUE='' |
|---|
| 8116 | WITH_TCL_FALSE='' |
|---|
| 8117 | WITH_TCL_TRUE='' |
|---|
| 8118 | WITH_WEBP_FALSE='' |
|---|
| 8119 | WITH_WEBP_TRUE='' |
|---|
| 8120 | WITH_WIN32_FALSE='' |
|---|
| 8121 | WITH_WIN32_TRUE='#' |
|---|
| 8122 | WITH_X_FALSE='' |
|---|
| 8123 | WITH_X_TRUE='' |
|---|
| 8124 | XMKMF='' |
|---|
| 8125 | XRENDER_CFLAGS='' |
|---|
| 8126 | XRENDER_LIBS='' |
|---|
| 8127 | X_CFLAGS='' |
|---|
| 8128 | X_EXTRA_LIBS='' |
|---|
| 8129 | X_LIBS='' |
|---|
| 8130 | X_PRE_LIBS='' |
|---|
| 8131 | YACC='bison -y' |
|---|
| 8132 | YFLAGS='' |
|---|
| 8133 | Z_INCLUDES='' |
|---|
| 8134 | Z_LIBS='' |
|---|
| 8135 | ac_ct_AR='ar' |
|---|
| 8136 | ac_ct_CC='/usr/bin/clang' |
|---|
| 8137 | ac_ct_CXX='' |
|---|
| 8138 | ac_ct_DUMPBIN='' |
|---|
| 8139 | ac_ct_OBJC='' |
|---|
| 8140 | am__EXEEXT_FALSE='' |
|---|
| 8141 | am__EXEEXT_TRUE='' |
|---|
| 8142 | am__fastdepCC_FALSE='#' |
|---|
| 8143 | am__fastdepCC_TRUE='' |
|---|
| 8144 | am__fastdepCXX_FALSE='#' |
|---|
| 8145 | am__fastdepCXX_TRUE='' |
|---|
| 8146 | am__fastdepOBJC_FALSE='' |
|---|
| 8147 | am__fastdepOBJC_TRUE='' |
|---|
| 8148 | am__include='include' |
|---|
| 8149 | am__isrc='' |
|---|
| 8150 | am__leading_dot='.' |
|---|
| 8151 | am__nodep='_no' |
|---|
| 8152 | am__quote='' |
|---|
| 8153 | am__rm_f_notfound='' |
|---|
| 8154 | am__tar='tar --format=ustar -chf - "$$tardir"' |
|---|
| 8155 | am__untar='tar -xf -' |
|---|
| 8156 | am__xargs_n='xargs -n' |
|---|
| 8157 | bindir='${exec_prefix}/bin' |
|---|
| 8158 | build='aarch64-apple-darwin24.3.0' |
|---|
| 8159 | build_alias='' |
|---|
| 8160 | build_cpu='aarch64' |
|---|
| 8161 | build_os='darwin24.3.0' |
|---|
| 8162 | build_vendor='apple' |
|---|
| 8163 | datadir='${datarootdir}' |
|---|
| 8164 | datarootdir='${prefix}/share' |
|---|
| 8165 | demodir='$(pkgdatadir)/demo' |
|---|
| 8166 | docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' |
|---|
| 8167 | dvidir='${docdir}' |
|---|
| 8168 | exec_prefix='NONE' |
|---|
| 8169 | host='aarch64-apple-darwin24.3.0' |
|---|
| 8170 | host_alias='' |
|---|
| 8171 | host_cpu='aarch64' |
|---|
| 8172 | host_os='darwin24.3.0' |
|---|
| 8173 | host_vendor='apple' |
|---|
| 8174 | htmldir='${docdir}' |
|---|
| 8175 | includedir='${prefix}/include' |
|---|
| 8176 | infodir='${datarootdir}/info' |
|---|
| 8177 | install_sh='${SHELL} /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_graphviz/graphviz/work/graphviz-12.2.1/config/install-sh' |
|---|
| 8178 | libdir='${exec_prefix}/lib' |
|---|
| 8179 | libexecdir='${exec_prefix}/libexec' |
|---|
| 8180 | localedir='${datarootdir}/locale' |
|---|
| 8181 | localstatedir='${prefix}/var' |
|---|
| 8182 | ltdl_LIBOBJS='' |
|---|
| 8183 | ltdl_LTLIBOBJS='' |
|---|
| 8184 | mandir='${datarootdir}/man' |
|---|
| 8185 | mkdir_p='$(MKDIR_P)' |
|---|
| 8186 | oldincludedir='/usr/include' |
|---|
| 8187 | pdfdir='${docdir}' |
|---|
| 8188 | pkgconfigdir='${libdir}/pkgconfig' |
|---|
| 8189 | prefix='/opt/local' |
|---|
| 8190 | program_transform_name='s,x,x,' |
|---|
| 8191 | psdir='${docdir}' |
|---|
| 8192 | runstatedir='${localstatedir}/run' |
|---|
| 8193 | sbindir='${exec_prefix}/sbin' |
|---|
| 8194 | sharedstatedir='${prefix}/com' |
|---|
| 8195 | subdirs='' |
|---|
| 8196 | sys_symbol_underscore='' |
|---|
| 8197 | sysconfdir='${prefix}/etc' |
|---|
| 8198 | target_alias='' |
|---|
| 8199 | |
|---|
| 8200 | ## ----------- ## |
|---|
| 8201 | ## confdefs.h. ## |
|---|
| 8202 | ## ----------- ## |
|---|
| 8203 | |
|---|
| 8204 | /* confdefs.h */ |
|---|
| 8205 | #define PACKAGE_NAME "graphviz" |
|---|
| 8206 | #define PACKAGE_TARNAME "graphviz" |
|---|
| 8207 | #define PACKAGE_VERSION "12.2.1" |
|---|
| 8208 | #define PACKAGE_STRING "graphviz 12.2.1" |
|---|
| 8209 | #define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" |
|---|
| 8210 | #define PACKAGE_URL "" |
|---|
| 8211 | #define GVPLUGIN_CONFIG_FILE "config6" |
|---|
| 8212 | #define GVPLUGIN_VERSION 6 |
|---|
| 8213 | #define DARWIN 1 |
|---|
| 8214 | #define DARWIN_DYLIB "" |
|---|
| 8215 | #define DEFAULT_DPI 96 |
|---|
| 8216 | #define BROWSER "open" |
|---|
| 8217 | #define YYTEXT_POINTER 1 |
|---|
| 8218 | #define HAVE_STDIO_H 1 |
|---|
| 8219 | #define HAVE_STDLIB_H 1 |
|---|
| 8220 | #define HAVE_STRING_H 1 |
|---|
| 8221 | #define HAVE_INTTYPES_H 1 |
|---|
| 8222 | #define HAVE_STDINT_H 1 |
|---|
| 8223 | #define HAVE_STRINGS_H 1 |
|---|
| 8224 | #define HAVE_SYS_STAT_H 1 |
|---|
| 8225 | #define HAVE_SYS_TYPES_H 1 |
|---|
| 8226 | #define HAVE_UNISTD_H 1 |
|---|
| 8227 | #define STDC_HEADERS 1 |
|---|
| 8228 | #define HAVE_DLFCN_H 1 |
|---|
| 8229 | #define LT_OBJDIR ".libs/" |
|---|
| 8230 | |
|---|
| 8231 | configure: exit 1 |
|---|