OSDN Git Service

* parser.c (cp_parser_class_specifier): Set class location to that
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / nontype12.C
1 // PR c++/20172
2 // Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
3
4 template<typename T> struct A
5 {
6   template<T> int foo();                        // { dg-error "double" }
7   template<template<T> class> int bar();        // { dg-error "double" }
8   template<T> struct X;                         // { dg-error "double" }
9 };
10
11 A<char>   a1;
12 A<double> a2;                                   // { dg-message "instantiated" }
13
14 template<typename T> struct B
15 {
16   template<double> int foo();                   // { dg-error "double" }
17   template<template<double> class> int bar();   // { dg-error "double" }
18   template<double> struct X;                    // { dg-error "double" }
19 };
20
21 template<void> int foo();                       // { dg-error "void" }
22 template<template<void> class> int bar();       // { dg-error "void" }
23 template<void> struct X;                        // { dg-error "void" }
24
25 template<typename T> struct C
26 {
27   template<T> int foo();                        // { dg-error "double" }
28 };
29
30 template<typename T> int baz(T) { C<T> c; }     // { dg-message "instantiated" }
31
32 void foobar()
33 {
34   baz(1.2);                                     // { dg-message "instantiated" }
35 }