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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [crash62.C] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed old-abort
3
#include 
4
 
5
        void
6
        fubar(std::ostream* out, const char* s)
7
        {
8
          (*out) << s << std::endl;
9
          return;
10
        }
11
 
12
        int
13
        main()
14
        {
15
          // Declare a ref and a pointer to the same ostream.
16
          //
17
          std::ostream* out = &std::cerr;
18
          std::ostream& die = std::cerr;
19
 
20
          // Valid call to fubar.
21
          //
22
          fubar(out, "First line.");
23
 
24
          // Invalid call to fubar. (1st arg is an ostream&. fubar expects
25
          // ostream*.)This should be a syntax error, but g++ does not catch it.
26
          // Call to this function results in a bus error in fubar when the 1st
27
          // arg is dereferenced.
28
          //
29
          fubar(die, "Second line.");// { dg-error "" }  cannot convert .die.*
30
 
31
          return 1;
32
        }

powered by: WebSVN 2.1.0

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