gcc/cp/ChangeLog:
PR c++/69091
* pt.c (type_dependent_expression_p): For a function template
specialization, a type is dependent iff any of its template
arguments are.
gcc/testsuite/ChangeLog:
PR c++/69091
* g++.dg/template/pr69091.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232463
138bc75d-0d04-0410-961f-
82ee72b054a4
2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
+ PR c++/69091
+ * pt.c (type_dependent_expression_p): For a function template
+ specialization, a type is dependent iff any of its template
+ arguments are.
+
+2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
+
* cp-array-notation.c (cp_expand_cond_array_notations): Return
error_mark_node only if find_rank failed, not if it was
successful.
|| dependent_scope_p (scope));
}
+ /* A function template specialization is type-dependent if it has any
+ dependent template arguments. */
if (TREE_CODE (expression) == FUNCTION_DECL
&& DECL_LANG_SPECIFIC (expression)
- && DECL_TEMPLATE_INFO (expression)
- && (any_dependent_template_arguments_p
- (INNERMOST_TEMPLATE_ARGS (DECL_TI_ARGS (expression)))))
- return true;
+ && DECL_TEMPLATE_INFO (expression))
+ return any_dependent_template_arguments_p (DECL_TI_ARGS (expression));
if (TREE_CODE (expression) == TEMPLATE_DECL
&& !DECL_TEMPLATE_TEMPLATE_PARM_P (expression))
2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
+ PR c++/69091
+ * g++.dg/template/pr69091.C: New test.
+
+2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
+
* c-c++-common/cilk-plus/AN/an-if.c: Check that the original
dump does not contain an error_mark_node.
* c-c++-common/cilk-plus/CK/pr60469.c: Likewise.
--- /dev/null
+// PR c++/69091
+// { dg-do compile { target c++14 } }
+
+template <class ValueType, ValueType>
+struct Option {};
+
+template <class ValueType, ValueType Value, class OptionsRhs>
+auto operator|(Option<ValueType, Value>, OptionsRhs) {
+ return Value;
+}
+
+enum canine_t { no, yes };
+Option<canine_t, no> cat;
+Option<canine_t, yes> dog;
+
+template <class T>
+void f(T) {
+ cat | dog;
+}
+
+struct A {};
+int main() {
+ f(A{});
+ return 0;
+}