OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [parse/] [casting-operator2.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
// Contributed by Martin Loewis 
3
// PR c++/8856: Make sure template conversion operators are not parsed as
4
//   template names.
5
 
6
struct K {};
7
template  struct K2 {};
8
 
9
template  struct A {
10
  template  operator U() { return U(); }
11
};
12
 
13
int main() {
14
  A a;
15
 
16
  (void)a.operator int();
17
  (void)a.operator double();
18
  (void)a.operator K2();
19
  (void)a.A::operator int();
20
  (void)a.A::operator double();
21
  (void)a.A::operator K2();
22
 
23
  (void)a.operator double();             // { dg-error "not a template" }
24
  (void)a.operator K();                  // { dg-error "not a template" }
25
  (void)a.A::operator double();  // { dg-error "not a template" }
26
  (void)a.A::operator K();       // { dg-error "not a template" }
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.