@@ -146,9 +146,12 @@ lvalue_kind (const_tree ref)
return clk_ordinary;
break;
- /* A currently unresolved scope ref. */
+ /* A scope ref in a template, left as SCOPE_REF to support later
+ access checking. */
case SCOPE_REF:
- gcc_unreachable ();
+ gcc_assert (!type_dependent_expression_p (CONST_CAST_TREE(ref)));
+ return lvalue_kind (TREE_OPERAND (ref, 1));
+
case MAX_EXPR:
case MIN_EXPR:
/* Disallow <? and >? as lvalues if either argument side-effects. */
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/46058
+
+class StringLiterals {
+public:
+ static const char dec[];
+};
+
+template<class St, class Base, const char* name>
+class NoValueCommand : public Base {
+public:
+};
+
+template<class St, class Base>
+class DecBasic : public NoValueCommand<St,Base,StringLiterals::dec> {
+};