cp-tree.h (enum cp_tree_index): Add CPTI_SOURCE_LOCATION_IMPL.
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 Dec 2019 23:32:15 +0000 (00:32 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 3 Dec 2019 23:32:15 +0000 (00:32 +0100)
commitff603745e385a1878a22fa3197911c9c4920a004
tree9a2d1f634abe953054189f529753c4803349fed5
parentdd2a16c741f11935fef856e29e6c71d27fd5c741
cp-tree.h (enum cp_tree_index): Add CPTI_SOURCE_LOCATION_IMPL.

* cp-tree.h (enum cp_tree_index): Add CPTI_SOURCE_LOCATION_IMPL.
(source_location_impl): Define.
(enum cp_built_in_function): Add CP_BUILT_IN_SOURCE_LOCATION.
(fold_builtin_source_location): Declare.
* cp-gimplify.c: Include output.h, file-prefix-map.h and cgraph.h.
(cp_gimplify_expr, cp_fold): Handle CP_BUILT_IN_SOURCE_LOCATION.
Formatting fix.
(get_source_location_impl_type): New function.
(struct source_location_table_entry,
struct source_location_table_entry_hash): New types.
(source_location_table, source_location_id): New variables.
(fold_builtin_source_location): New function.
* constexpr.c (cxx_eval_builtin_function_call): Handle
CP_BUILT_IN_SOURCE_LOCATION.
* tree.c (builtin_valid_in_constant_expr_p): Likewise.  Formatting
fix.
* decl.c (cxx_init_decl_processing): Register
__builtin_source_location.
* name-lookup.c (get_std_name_hint): Add source_location entry.

* g++.dg/cpp2a/srcloc1.C: New test.
* g++.dg/cpp2a/srcloc2.C: New test.
* g++.dg/cpp2a/srcloc3.C: New test.
* g++.dg/cpp2a/srcloc4.C: New test.
* g++.dg/cpp2a/srcloc5.C: New test.
* g++.dg/cpp2a/srcloc6.C: New test.
* g++.dg/cpp2a/srcloc7.C: New test.
* g++.dg/cpp2a/srcloc8.C: New test.
* g++.dg/cpp2a/srcloc9.C: New test.
* g++.dg/cpp2a/srcloc10.C: New test.
* g++.dg/cpp2a/srcloc11.C: New test.
* g++.dg/cpp2a/srcloc12.C: New test.
* g++.dg/cpp2a/srcloc13.C: New test.
* g++.dg/cpp2a/srcloc14.C: New test.

From-SVN: r278949
22 files changed:
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-gimplify.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/srcloc1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc13.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc14.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/srcloc9.C [new file with mode: 0644]