aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-cppbuiltin.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-12-01 11:44:34 -0800
committerNathan Sidwell <nathan@acm.org>2020-12-01 11:47:32 -0800
commit41676a36a04d5ef86012195d84830df191ee6790 (patch)
treec76e3047ed1adb2472ccc0bf119b43d51b3e5c96 /gcc/c-family/c-cppbuiltin.c
parent6e3603e62ac3a811e0a1032821b8d045b020a9c1 (diff)
downloadgcc-41676a36a04d5ef86012195d84830df191ee6790.zip
gcc-41676a36a04d5ef86012195d84830df191ee6790.tar.gz
gcc-41676a36a04d5ef86012195d84830df191ee6790.tar.bz2
C++ Module keywords
This adds the module keywords. These are special internal tokens generated by the preprocessor's module-control-line token peeking logic. Spelling them with a space means that they turn back into regular tokens in preprocessor output (but do skew the column numbering :() gcc/c-family/ * c-common.c (module, import, export): New internal tokens (with trailing space). * c-common.h (RID__MODULE, RID__IMPORT & RID__EXPORT): Enumerate them. (D_CXX_MODULES, D_CXX_MODULES_FLAGS): Enable them. * c-cppbuiltin.c (c_cpp_builtins): Feature macro. gcc/cp/ * lex.c (init_reswords): Maybe enable module keywords.
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r--gcc/c-family/c-cppbuiltin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index d35b087..41914f6 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1025,6 +1025,10 @@ c_cpp_builtins (cpp_reader *pfile)
else
cpp_define (pfile, "__cpp_concepts=201507L");
}
+ if (flag_modules)
+ /* The std-defined value is 201907L, but I don't think we can
+ claim victory yet. 201810 is the p1103 date. */
+ cpp_define (pfile, "__cpp_modules=201810L");
if (flag_coroutines)
cpp_define (pfile, "__cpp_impl_coroutine=201902L"); /* n4861, DIS */
if (flag_tm)