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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [ctor1.C] - Blame information for rev 715

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2001 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 31 Dec 2001 
5
 
6
// PR 5132. ICE on struct constructors in templates.
7
 
8
// snippets from bits/huge_val.h
9
 
10
#define __HUGE_VAL_bytes        { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
11
#define __huge_val_t    union { unsigned char __c[8]; double __d; }
12
#define HUGE_VAL       (__extension__ \
13
  ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
14
 
15
void foo( const int&) {
16
  HUGE_VAL; // no problem here
17
}
18
 
19
template 
20
void Tfoo( const F&) {
21
  HUGE_VAL; // g++ fails here
22
}
23
 
24
template  struct M { T m; };
25
 
26
void Foo ()
27
{
28
  Tfoo (1.2f);
29
  (__extension__ ((M) {m:3}));
30
  (__extension__ ((M []) {{m:3}}));
31
}

powered by: WebSVN 2.1.0

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