diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-01-23 08:46:05 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-01-23 08:46:05 +0100 |
commit | 2e73a89bc9a73ef83b7b87fb65b8293c0ae8b693 (patch) | |
tree | a57d36153388b50d5bdc27beb742519a3a6836b2 /gcc/tree.c | |
parent | 38ad6f8a440f7594b9cea5fb999078035ee36a57 (diff) | |
download | gcc-2e73a89bc9a73ef83b7b87fb65b8293c0ae8b693.zip gcc-2e73a89bc9a73ef83b7b87fb65b8293c0ae8b693.tar.gz gcc-2e73a89bc9a73ef83b7b87fb65b8293c0ae8b693.tar.bz2 |
re PR c++/83918 ([c++17] ICE on constexpr eval of datatype involving function and variadic template)
PR c++/83918
* tree.c (maybe_wrap_with_location): Use NON_LVALUE_EXPR rather than
VIEW_CONVERT_EXPR to wrap CONST_DECLs.
* g++.dg/cpp1z/pr83918.C: New test.
From-SVN: r256972
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -14085,8 +14085,10 @@ maybe_wrap_with_location (tree expr, location_t loc) if (EXCEPTIONAL_CLASS_P (expr)) return expr; - tree_code code = (CONSTANT_CLASS_P (expr) && TREE_CODE (expr) != STRING_CST - ? NON_LVALUE_EXPR : VIEW_CONVERT_EXPR); + tree_code code + = (((CONSTANT_CLASS_P (expr) && TREE_CODE (expr) != STRING_CST) + || (TREE_CODE (expr) == CONST_DECL && !TREE_STATIC (expr))) + ? NON_LVALUE_EXPR : VIEW_CONVERT_EXPR); tree wrapper = build1_loc (loc, code, TREE_TYPE (expr), expr); /* Mark this node as being a wrapper. */ EXPR_LOCATION_WRAPPER_P (wrapper) = 1; |