]> granicus.if.org Git - clang/commitdiff
Add reference/non-reference mismatch test.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 27 Dec 2016 06:18:22 +0000 (06:18 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 27 Dec 2016 06:18:22 +0000 (06:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290587 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaTemplate/temp_arg_nontype.cpp

index 4c63c7eee9efa4e641f97b652a5098d13c267f76..e99c56ba1f5e67ebb94df2ac48713fe6a4fcbd9b 100644 (file)
@@ -389,7 +389,7 @@ namespace partial_order_references {
   int N;
   A<0, 0, N> a;
 
-  // FIXME: These should both be rejected as they are not more specialized than
+  // FIXME: These should all be rejected as they are not more specialized than
   // the primary template (they can never be used due to the type mismatch).
   template<int, int &R> struct B; // expected-note {{template}}
   template<const int &R> struct B<0, R> {};
@@ -398,4 +398,9 @@ namespace partial_order_references {
   template<int, const int &R> struct C; // expected-note {{template}}
   template<int &R> struct C<0, R> {};
   C<0, N> c; // expected-error {{undefined}}
+
+  template<int, const int &R> struct D; // expected-note {{template}}
+  template<int N> struct D<0, N> {};
+  extern const int K = 5;
+  D<0, K> d; // expected-error {{undefined}}
 }