blob: f0899018f7f0754216939dc647fc1d84259fb532 [file] [log] [blame]
Richard Smith6642bb32016-03-24 19:12:22 +00001// RUN: not %clang_cc1 %s -fsyntax-only 2>&1 | FileCheck %s
2
3// Ensure that the diagnostics we produce for this situation appear in a
4// deterministic order. This requires ADL to provide lookup results in a
5// deterministic order.
6template<typename T> struct Error { typedef typename T::error error; };
7struct X { template<typename T> friend typename Error<T>::error f(X, T); };
8struct Y { template<typename T> friend typename Error<T>::error f(T, Y); };
9
10void g() {
11 f(X(), Y());
12}
13
14// We don't really care which order these two diagnostics appear (although the
15// order below is source order, which seems best). The crucial fact is that
16// there is one single order that is stable across multiple runs of clang.
17//
18// CHECK: no type named 'error' in 'Y'
19// CHECK: no type named 'error' in 'X'
20// CHECK: no matching function for call to 'f'