Commit 6481daa9 by Mark Mitchell Committed by Mark Mitchell

g++-dg.exp (g++-dg-test): Add "repo" option.

	* lib/g++-dg.exp (g++-dg-test): Add "repo" option.
	(dg-gpp-additional-sources): New function.
	(dg-gpp-additional-files): Likewise.
	* lib/g++.exp (additional_sources): New variable.
	(additional_files): Likewise.
	(g++_target_compile): Deal with them.
	* lib/old-dejagnu.exp: Remove.
	* g++.old-deja/old-deja.exp: Use dg.exp, not old-dejagnu.exp.
	* g++.old-deja: Revise all tests to use dg commands.

From-SVN: r66317
parent 44c8a5f8

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

2003-04-30 Mark Mitchell <mark@codesourcery.com>
* lib/g++-dg.exp (g++-dg-test): Add "repo" option.
(dg-gpp-additional-sources): New function.
(dg-gpp-additional-files): Likewise.
* lib/g++.exp (additional_sources): New variable.
(additional_files): Likewise.
(g++_target_compile): Deal with them.
* lib/old-dejagnu.exp: Remove.
* g++.old-deja/old-deja.exp: Use dg.exp, not old-dejagnu.exp.
* g++.old-deja: Revise all tests to use dg commands.
2003-04-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2003-04-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9432, c++/9528 PR c++/9432, c++/9528
......
// Skip if not target: i?86-*-linux* i?86-*-freebsd* // { dg-do run { target i?86-*-linux* i?86-*-freebsd* } }
// Special g++ Options: -malign-double // { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com> // Origin: Alex Samuel <samuel@codesourcery.com>
/* Test the data layout of C aggregates by checking aggregate size and /* Test the data layout of C aggregates by checking aggregate size and
......
// Skip if not target: i?86-*-linux* i?86-*-freebsd* // { dg-do run { target i?86-*-linux* i?86-*-freebsd* } }
// Special g++ Options: -malign-double // { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com> // Origin: Alex Samuel <samuel@codesourcery.com>
/* Test the size and alignment of fundamental C types for compliance /* Test the size and alignment of fundamental C types for compliance
......
// { dg-do run }
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
......
// Skip if not target: i?86-*-linux* i?86-*-freebsd* // { dg-do run { target i?86-*-linux* i?86-*-freebsd* } }
// Special g++ Options: -malign-double // { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com> // Origin: Alex Samuel <samuel@codesourcery.com>
/* Test the layout of bitfields in C aggretagtes for compliance with /* Test the layout of bitfields in C aggretagtes for compliance with
......
// Build don't link: // { dg-do assemble }
// //
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 11 Apr 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 11 Apr 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Test __cxa_vec routines // Test __cxa_vec routines
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Apr 2000 <nathan@nathan@codesourcery.com> // Contributed by Nathan Sidwell 7 Apr 2000 <nathan@nathan@codesourcery.com>
......
// Special g++ Options: -w // { dg-do run }
// { dg-options "-w" }
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
......
// Build don't link: // { dg-do assemble }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com>
......
// Build don't link: // { dg-do assemble }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
......
// Build don't link: // { dg-do assemble }
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
struct S {}; struct S {};
......
// { dg-do run }
// Test to see that primary bases are selected correctly. // Test to see that primary bases are selected correctly.
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Test rtti pointer flags // Test rtti pointer flags
// Copyright (C) 2000, 2002 Free Software Foundation, Inc. // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Apr 2000 <nathan@nathan@codesourcery.com> // Contributed by Nathan Sidwell 15 Apr 2000 <nathan@nathan@codesourcery.com>
......
// Special g++ Options: -fno-strict-aliasing // { dg-do run }
// { dg-options "-fno-strict-aliasing" }
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
/* Generally, the lowest bit of the ptr is used to indicate whether a /* Generally, the lowest bit of the ptr is used to indicate whether a
......
// { dg-do run }
// Copyright (C) 2000 Free Software Foundation, Inc. // Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 16 Jan 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 16 Jan 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Jun 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 9 Jun 2001 <nathan@codesourcery.com>
......
// Build don't link: // { dg-do assemble }
// //
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com>
......
// Build don't link: // { dg-do assemble }
// //
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Build don't run // Build don't run
// //
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
......
// Special g++ Options: -w // { dg-do run }
// { dg-options "-w" }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
......
// Special g++ Options: -ansi -pedantic-errors -w // { dg-do run }
// { dg-options "-ansi -pedantic-errors -w" }
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 14 Jun 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 14 Jun 2001 <nathan@codesourcery.com>
......
// { dg-do run }
// Test rtti hint flags // Test rtti hint flags
// Copyright (C) 2000, 2003 Free Software Foundation, Inc. // Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 3 Apr 2000 <nathan@nathan@codesourcery.com> // Contributed by Nathan Sidwell 3 Apr 2000 <nathan@nathan@codesourcery.com>
......
// { dg-do run }
// { dg-options "-fno-strict-aliasing" }
// Test various aspects of vtable layout. // Test various aspects of vtable layout.
// Special g++ Options: -fno-strict-aliasing
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
......
// { dg-do run }
// { dg-options "-fno-strict-aliasing" }
// Origin: Mark Mitchell <mark@codesourcery.com> // Origin: Mark Mitchell <mark@codesourcery.com>
// Special g++ Options: -fno-strict-aliasing
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B1_EMPTY #define B1_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define B1_EMPTY #define B1_EMPTY
#define B2_EMPTY #define B2_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B2_EMPTY #define B2_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B1_EMPTY #define B1_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B1_EMPTY #define B1_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B1_EMPTY #define B1_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B1_EMPTY #define B1_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define A_EMPTY #define A_EMPTY
#define B1_EMPTY #define B1_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define B1_EMPTY #define B1_EMPTY
#define B2_EMPTY #define B2_EMPTY
......
// Copyright (C) 2000 Free Software Foundation, Inc. // { dg-do run }
// { dg-gpp-additional-files "vtable3.h" }
// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com> // Contributed by Nathan Sidwell 4 February 2001 <nathan@codesourcery.com>
// Check constructor vtables work. // Check constructor vtables work.
// Additional files: vtable3.h
#define B1_EMPTY #define B1_EMPTY
#define B2_EMPTY #define B2_EMPTY
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/13478 // g++/13478
// Build don't link:
class A {}; class A {};
class AData {}; class AData {};
...@@ -26,8 +26,8 @@ const hand_table Agent::table_1[] = ...@@ -26,8 +26,8 @@ const hand_table Agent::table_1[] =
{ {
{0, &Agent::table_2}, {0, &Agent::table_2},
{first, &Agent::foo}, {first, &Agent::foo},
{last, &(hand)Agent::foo} // ERROR - no match {last, &(hand)Agent::foo} // { dg-error "" } no match
}; // ERROR - cannot convert }; // { dg-error "" } cannot convert
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/13523 // g++/13523
// Build don't link:
template<typename T> class latin_america; template<typename T> class latin_america;
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/13908 // g++/13908
// Build don't link:
class chile class chile
{ {
...@@ -17,5 +17,5 @@ void bar (chile* pobj, pmf pmethod) ...@@ -17,5 +17,5 @@ void bar (chile* pobj, pmf pmethod)
{ {
//-edg: expected member name //-edg: expected member name
//-g++: taking address of bound pointer-to-member expression //-g++: taking address of bound pointer-to-member expression
foo = (void*) &(pobj->*pmethod); // ERROR - foo = (void*) &(pobj->*pmethod); // { dg-error "" }
} }
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/14309 // g++/14309
// test for global functions, mf's, and templatized mf's. // test for global functions, mf's, and templatized mf's.
// Build don't link:
static int fooe_1(void) { return 5; } static int fooe_1(void) { return 5; }
static int fooe_2(int x = fooe_1()) { return x; } static int fooe_2(int x = fooe_1()) { return x; }
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/14664 - test // g++/14664 - test
// Build don't link:
char foo[26]; char foo[26];
...@@ -8,7 +8,7 @@ void bar() ...@@ -8,7 +8,7 @@ void bar()
{ {
//-g++: incompatible types in assignment of 'const char[]' to 'char[]' //-g++: incompatible types in assignment of 'const char[]' to 'char[]'
//-edg: expression must be a modifiable lvalue //-edg: expression must be a modifiable lvalue
foo = "0123456789012345678901234"; // ERROR - // ERROR - foo = "0123456789012345678901234"; // { dg-error "" } // ERROR -
} }
......
// { dg-do assemble }
// { dg-options "-fpermissive -w" }
// 981203 bkoz // 981203 bkoz
// g++/14664 + test // g++/14664 + test
// Build don't link:
// Special g++ Options: -fpermissive -w
char foo[26]; char foo[26];
......
// { dg-do run }
// 981203 bkoz // 981203 bkoz
// g++/14687 // g++/14687
......
// { dg-do assemble }
// { dg-options "-Wno-pointer-arith" }
// 981203 bkoz // 981203 bkoz
// g++/15054 // g++/15054
// Build don't link:
// Special g++ Options: -Wno-pointer-arith
// note that -pedantic also turns on this warning // note that -pedantic also turns on this warning
void cuba(void) { void cuba(void) {
......
// { dg-do run }
// 981203 bkoz // 981203 bkoz
// g++/15071 // g++/15071
// gcc invocation fails to link in libstdc++ // gcc invocation fails to link in libstdc++
......
// { dg-do assemble }
// { dg-options "-Wnon-virtual-dtor -Weffc++" }
// 981203 bkoz // 981203 bkoz
// g++/15309 // g++/15309
// Build don't link:
// Special g++ Options: -Wnon-virtual-dtor -Weffc++
class bahamian { class bahamian {
public: public:
...@@ -10,7 +10,7 @@ public: ...@@ -10,7 +10,7 @@ public:
}; };
class miami : public bahamian class miami : public bahamian
{ // WARNING - // WARNING - { // { dg-warning "" } // WARNING -
public: public:
miami (); miami ();
~miami (); ~miami ();
......
// { dg-do assemble }
// { dg-options "-Wnon-virtual-dtor -Weffc++" }
// 981203 bkoz // 981203 bkoz
// g++/15309 // g++/15309
// Build don't link:
// Special g++ Options: -Wnon-virtual-dtor -Weffc++
class bermuda { // WARNING - // WARNING - class bermuda { // { dg-warning "" } // WARNING -
public: public:
virtual int func1(int); virtual int func1(int);
~bermuda(); ~bermuda();
......
// { dg-do run }
// { dg-options "-fno-const-strings" }
// 981203 bkoz // 981203 bkoz
// g++/15351 - test // g++/15351 - test
// Special g++ Options: -fno-const-strings
#include <assert.h> #include <assert.h>
......
// { dg-do run }
// { dg-options "-fconst-strings" }
// 981203 bkoz // 981203 bkoz
// g++/15351 + test // g++/15351 + test
// Special g++ Options: -fconst-strings
#include <assert.h> #include <assert.h>
......
// { dg-do assemble }
// { dg-options "-Wsign-promo" }
// 981203 bkoz // 981203 bkoz
// g++/15756 test1 // g++/15756 test1
// Build don't link:
// Special g++ Options: -Wsign-promo
enum e_value { first = 0, next = 30 }; enum e_value { first = 0, next = 30 };
......
// { dg-do assemble }
// { dg-options "-Wsign-promo" }
// 981203 bkoz // 981203 bkoz
// g++/15756 test2 // g++/15756 test2
// Build don't link:
// Special g++ Options: -Wsign-promo
// this test may only be valid for 32bit targets at present // this test may only be valid for 32bit targets at present
#include <limits.h> #include <limits.h>
...@@ -31,8 +31,8 @@ struct caracas { ...@@ -31,8 +31,8 @@ struct caracas {
int main () int main ()
{ {
caracas obj_ei ( enum_int ); // WARNING - caracas obj_ei ( enum_int ); // { dg-warning "" }
caracas obj_eui ( enum_uint ); // WARNING - caracas obj_eui ( enum_uint ); // { dg-warning "" }
caracas obj_i ( i ); caracas obj_i ( i );
caracas obj_ui ( ui ); caracas obj_ui ( ui );
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/15799 test1 // g++/15799 test1
// Build don't link:
/* /*
15799.cpp: In function `void foo()': 15799.cpp: In function `void foo()':
...@@ -15,15 +15,15 @@ typedef unsigned long uint_32; ...@@ -15,15 +15,15 @@ typedef unsigned long uint_32;
class sanjose { class sanjose {
public: public:
sanjose(); sanjose();
sanjose(const sanjose&); // ERROR - candidate sanjose(const sanjose&); // { dg-error "" } candidate
sanjose(int_8 value); // ERROR - // ERROR - sanjose(int_8 value); // { dg-error "" } // ERROR -
sanjose(uint_32 value); // ERROR - // ERROR - sanjose(uint_32 value); // { dg-error "" } // ERROR -
}; };
enum { first, last}; enum { first, last};
void foo(void) { void foo(void) {
sanjose obj(first); // ERROR - // ERROR - sanjose obj(first); // { dg-error "" } // ERROR -
} }
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/15800 - test // g++/15800 - test
// Build don't link:
struct panama { struct panama {
panama(); panama();
panama(panama &); panama(panama &);
panama& operator=(panama&); // ERROR - // ERROR - panama& operator=(panama&); // { dg-error "" } // ERROR -
}; };
extern panama dig(); extern panama dig();
void foo() { void foo() {
panama obj; panama obj;
obj = dig(); // ERROR - // ERROR - obj = dig(); // { dg-error "" } // ERROR -
} }
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/15800 + test // g++/15800 + test
// Build don't link:
struct panama { struct panama {
panama(); panama();
......
// { dg-do run }
// 981203 bkoz // 981203 bkoz
// g++/15822 // g++/15822
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/16077 // g++/16077
// Build don't link:
class nicaragua; class nicaragua;
struct colombia { struct colombia {
...@@ -20,7 +20,7 @@ public: ...@@ -20,7 +20,7 @@ public:
void peace(const colombia&); void peace(const colombia&);
void foo(nicaragua& b) { void foo(nicaragua& b) {
peace(b); // WARNING - // WARNING - peace(b); // { dg-warning "" } // WARNING -
} }
......
// { dg-do assemble }
// 981203 bkoz // 981203 bkoz
// g++/16567 // g++/16567
// Build don't link:
typedef bool Bool; typedef bool Bool;
typedef unsigned char Uint8; typedef unsigned char Uint8;
...@@ -35,7 +35,7 @@ void foo(void) { ...@@ -35,7 +35,7 @@ void foo(void) {
control *fp = &obj; control *fp = &obj;
e_ms result; e_ms result;
result = (e_ms) fp->foo_1; // ERROR - // ERROR - result = (e_ms) fp->foo_1; // { dg-error "" } // ERROR -
} }
......
// { dg-do assemble }
// 981204 bkoz // 981204 bkoz
// g++/17922 // g++/17922
// Build don't link:
class base { }; class base { };
......
// { dg-do assemble }
// 981204 bkoz // 981204 bkoz
// g++/17930 // g++/17930
// Build don't link:
char const one[] = "test"; char const one[] = "test";
char const two[] = one; // ERROR - // ERROR - char const two[] = one; // { dg-error "" } // ERROR -
// { dg-do assemble }
// 981204 bkoz // 981204 bkoz
// g++/18208 // g++/18208
// Build don't link:
typedef unsigned int uint_32; typedef unsigned int uint_32;
...@@ -17,9 +17,9 @@ void foo( ) ...@@ -17,9 +17,9 @@ void foo( )
puertorico obj; puertorico obj;
// Bug using static_cast<> // Bug using static_cast<>
ui = static_cast<uint_32>(obj); // ERROR - // ERROR - ui = static_cast<uint_32>(obj); // { dg-error "" } // ERROR -
// Bug when missing the pair of braces // Bug when missing the pair of braces
ui = (uint_32) obj.f; // ERROR - // ERROR - ui = (uint_32) obj.f; // { dg-error "" } // ERROR -
} }
// { dg-do run }
//980323 bkoz //980323 bkoz
//test for bools with inclusive ors //test for bools with inclusive ors
......
// { dg-do run }
//980324 bkoz //980324 bkoz
//test for bool and bitwise ands //test for bool and bitwise ands
......
// Build don't link: // { dg-do assemble }
//980610 bkoz //980610 bkoz
// example 1: buggy // example 1: buggy
......
// Build don't link: // { dg-do assemble }
//980610 bkoz //980610 bkoz
// example 2: ok // example 2: ok
......
// Build don't link: // { dg-do assemble }
// prms-id: 12475 // prms-id: 12475
#include <limits.h> #include <limits.h>
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
#error "Unsupported test -- add new constants." #error "Unsupported test -- add new constants."
#endif #endif
enum huh { start =-TEST, next }; // WARNING - enum huh { start =-TEST, next }; // { dg-warning "" }
// Build don't link: // { dg-do assemble }
// Special g++ Options: -Wno-deprecated // { dg-options "-Wno-deprecated" }
// prms-id: 13417 // prms-id: 13417
class Foo { class Foo {
...@@ -7,5 +7,5 @@ public: ...@@ -7,5 +7,5 @@ public:
explicit Foo (int){} explicit Foo (int){}
}; };
Foo f(10); Foo f(10);
Foo blat() return f(4){} // ERROR - named return value Foo blat() return f(4){} // { dg-error "" } named return value
// Build don't link: // { dg-do assemble }
// prms-id: 13721 // prms-id: 13721
class A class A
......
// Build don't link: // { dg-do assemble }
// 980604 bkoz // 980604 bkoz
// 3.4.5 Class member access p 4 // 3.4.5 Class member access p 4
// nested and non-nested calls, no dtors // nested and non-nested calls, no dtors
......
// Build don't link: // { dg-do assemble }
//980529 bkoz //980529 bkoz
//3.4.5 Class member access via pointer and non-pointer //3.4.5 Class member access via pointer and non-pointer
// non-nested dtor calls // non-nested dtor calls
......
// Build don't link: // { dg-do assemble }
// prms-id: 13911 // prms-id: 13911
template<unsigned int N> template<unsigned int N>
......
// Build don't link: // { dg-do assemble }
//980519 bad error from nathan //980519 bad error from nathan
//$ egcs -fhonor-std -nostdinc -c redef.C //$ egcs -fhonor-std -nostdinc -c redef.C
//redef.C:56: redefinition of default argument for `class _Traits' //redef.C:56: redefinition of default argument for `class _Traits'
......
// Build don't link: // { dg-do assemble }
// 980808-980824 bkoz // 980808-980824 bkoz
// template parameter redeclaration bugs // template parameter redeclaration bugs
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// 01 // 01
// declared friend template // declared friend template
template <class T4>// ERROR - .* template <class T4>// { dg-error "" } .*
class Xone { class Xone {
protected: protected:
T4* next; T4* next;
...@@ -32,13 +32,13 @@ public: ...@@ -32,13 +32,13 @@ public:
// can also do template-decl and then can ditch the foward-declaration // can also do template-decl and then can ditch the foward-declaration
// template <class T5> friend bool isequal (Xone<T5>& lhs, Xone<T5>& rhs); // template <class T5> friend bool isequal (Xone<T5>& lhs, Xone<T5>& rhs);
// this is not ok: // this is not ok:
template <class T4> friend bool isequal (Xone<T4>& lhs, Xone<T4>& rhs);// ERROR - .* template <class T4> friend bool isequal (Xone<T4>& lhs, Xone<T4>& rhs);// { dg-error "" } .*
}; };
// 02 // 02
// nested template class // nested template class
template <class T6>// ERROR - .* template <class T6>// { dg-error "" } .*
class Xtwo { class Xtwo {
protected: protected:
T6* next; T6* next;
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
Xtwo(): next(0), prev(0), value(1999){} Xtwo(): next(0), prev(0), value(1999){}
Xtwo(T6 init): value(init) {} Xtwo(T6 init): value(init) {}
template <class T6> class nested {// ERROR - .* template <class T6> class nested {// { dg-error "" } .*
T6 value; T6 value;
public: public:
nested(): value( T6(0)) {} nested(): value( T6(0)) {}
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
// 03 // 03
// member templates // member templates
template <class T8>// ERROR - .* template <class T8>// { dg-error "" } .*
class Xthree { class Xthree {
protected: protected:
T8* next; T8* next;
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
Xthree(): next(0), prev(0), value(1999){} Xthree(): next(0), prev(0), value(1999){}
Xthree(T8 init): value(init) {} Xthree(T8 init): value(init) {}
template <class T8> T8 comp_ge(T8 test) {// ERROR - .* template <class T8> T8 comp_ge(T8 test) {// { dg-error "" } .*
T8 local_value; T8 local_value;
if (local_value > value) if (local_value > value)
return local_value; return local_value;
...@@ -80,8 +80,8 @@ public: ...@@ -80,8 +80,8 @@ public:
// 04 // 04
// local names (14.6.1 p 4) // local names (14.6.1 p 4)
template <class T10, int i> struct Xfour {// ERROR - .* template <class T10, int i> struct Xfour {// { dg-error "" } .*
int T10; // ERROR - .* int T10; // { dg-error "" } .*
void f(){ void f(){
char T10; char T10;
} }
...@@ -94,15 +94,15 @@ template <class T12, int i> struct Xfive { ...@@ -94,15 +94,15 @@ template <class T12, int i> struct Xfive {
void f(); void f();
}; };
template <class T13, int i> void Xfive<T13,i>::f() {// ERROR - .* template <class T13, int i> void Xfive<T13,i>::f() {// { dg-error "" } .*
int T13; // ERROR - .* int T13; // { dg-error "" } .*
int T12; //should be ok int T12; //should be ok
} }
// 06 // 06
// multiple names at the same level // multiple names at the same level
template <class T14, class T14> class Xsix { // ERROR - .* template <class T14, class T14> class Xsix { // { dg-error "" } .*
private: private:
public: public:
void f(); void f();
...@@ -111,14 +111,14 @@ public: ...@@ -111,14 +111,14 @@ public:
// 07 // 07
// multiple names, one in template parameter one in class-name // multiple names, one in template parameter one in class-name
template <class T12> class T12; // ERROR - .* template <class T12> class T12; // { dg-error "" } .*
// 08 // 08
// with multiple template params, and second (third) one is redeclared // with multiple template params, and second (third) one is redeclared
template <class T16, int i, class T161> class Xseven { // ERROR - .* template <class T16, int i, class T161> class Xseven { // { dg-error "" } .*
private: private:
char T161; // ERROR - .* char T161; // { dg-error "" } .*
public: public:
template <class U> template <class U>
friend bool fooy(U u); friend bool fooy(U u);
...@@ -126,8 +126,8 @@ public: ...@@ -126,8 +126,8 @@ public:
template <class T161> template <class T161>
friend bool foo(T161 u) friend bool foo(T161 u)
{ {
Xseven<T161, 5, int> obj; // ERROR - .* Xseven<T161, 5, int> obj; // { dg-error "" } .*
return (obj.inst == u.inst); // ERROR - .* return (obj.inst == u.inst); // { dg-error "" } .*
} }
}; };
...@@ -158,27 +158,27 @@ struct S1 ...@@ -158,27 +158,27 @@ struct S1
// 10 // 10
// check for non-type parameters, should still be able to redeclare? // check for non-type parameters, should still be able to redeclare?
// local names (14.6.1 p 4) // local names (14.6.1 p 4)
template <class T18, int i> class Xten {// ERROR - .* template <class T18, int i> class Xten {// { dg-error "" } .*
float i; // ERROR - .* float i; // { dg-error "" } .*
}; };
// 11 // 11
// declared friend template, non-type parameters // declared friend template, non-type parameters
template <long l>// ERROR - .* template <long l>// { dg-error "" } .*
class Xeleven { class Xeleven {
public: public:
template <long l> friend bool isequal (Xeleven<5> lhs, Xeleven<5> rhs); // ERROR - .* template <long l> friend bool isequal (Xeleven<5> lhs, Xeleven<5> rhs); // { dg-error "" } .*
}; };
// 12 // 12
// nested template class, non-type parameters // nested template class, non-type parameters
template <long l>// ERROR - .* template <long l>// { dg-error "" } .*
class Xtwelve { class Xtwelve {
public: public:
template <long l> class nested {// ERROR - . template <long l> class nested {// { dg-error "" } .
long value; long value;
public: public:
nested(): value(0) {} nested(): value(0) {}
...@@ -188,14 +188,14 @@ public: ...@@ -188,14 +188,14 @@ public:
// 13 // 13
// member templates, non-type parameters // member templates, non-type parameters
template <long l>// ERROR - .* template <long l>// { dg-error "" } .*
struct Xthirteen { struct Xthirteen {
template <long l> long comp_ge(long test) {// ERROR - . template <long l> long comp_ge(long test) {// { dg-error "" } .
long local_value; long local_value;
if (local_value > value) // ERROR - .* if (local_value > value) // { dg-error "" } .*
return local_value; return local_value;
else else
return value; // ERROR - .* return value; // { dg-error "" } .*
} }
}; };
......
// Build don't link: // { dg-do assemble }
// 980827 bkoz // 980827 bkoz
// template parameter redeclaration bugs, part two: // template parameter redeclaration bugs, part two:
// template template params and expanded template non-type parms // template template params and expanded template non-type parms
...@@ -18,27 +18,27 @@ ...@@ -18,27 +18,27 @@
// 14 // 14
// declared friend template (v3, template type parameters) // declared friend template (v3, template type parameters)
template <class T4>// ERROR - .* template <class T4>// { dg-error "" } .*
class Xfourteen { class Xfourteen {
protected: protected:
T4 value; T4 value;
public: public:
Xfourteen(T4 init): value(init) {} Xfourteen(T4 init): value(init) {}
template <template <typename T4> class T5> // ERROR - .* template <template <typename T4> class T5> // { dg-error "" } .*
friend bool isequal (Xfourteen<int>& lhs, Xfourteen<int>& rhs); friend bool isequal (Xfourteen<int>& lhs, Xfourteen<int>& rhs);
}; };
// 15 // 15
// nested template class (v3, template type parameters) // nested template class (v3, template type parameters)
template <class T6>// ERROR - .* template <class T6>// { dg-error "" } .*
class Xfifteen { class Xfifteen {
protected: protected:
T6 value; T6 value;
public: public:
Xfifteen(T6 init): value(init) {} Xfifteen(T6 init): value(init) {}
template <template <typename T6> class T7> class nested {// ERROR - .* template <template <typename T6> class T7> class nested {// { dg-error "" } .*
int value; int value;
public: public:
nested(): value( int(0)) {} nested(): value( int(0)) {}
...@@ -48,14 +48,14 @@ public: ...@@ -48,14 +48,14 @@ public:
// 16 // 16
// member templates (v3, template type parameters) // member templates (v3, template type parameters)
template <class T8>// ERROR - .* template <class T8>// { dg-error "" } .*
class Xsixteen { class Xsixteen {
protected: protected:
T8 value; T8 value;
public: public:
Xsixteen(T8 init): value(init) {} Xsixteen(T8 init): value(init) {}
template <template <typename T8> class T9> int comp_ge(int test) {// ERROR - .* template <template <typename T8> class T9> int comp_ge(int test) {// { dg-error "" } .*
int local_value; int local_value;
if (local_value > value) if (local_value > value)
return local_value; return local_value;
...@@ -88,21 +88,21 @@ public: ...@@ -88,21 +88,21 @@ public:
// 18 // 18
// more template template redecl tests // more template template redecl tests
template <typename T14, template <typename T15> class C12>// ERROR - .* template <typename T14, template <typename T15> class C12>// { dg-error "" } .*
class Xeighteen { class Xeighteen {
protected: protected:
C12<T14> value; C12<T14> value;
int C12; // ERROR - .* int C12; // { dg-error "" } .*
}; };
// 19 // 19
// more template template redecl tests // more template template redecl tests
template <typename T16, template <typename T17> class C14>// ERROR - .* template <typename T16, template <typename T17> class C14>// { dg-error "" } .*
class Xnineteen{ class Xnineteen{
protected: protected:
C14<T16> value; C14<T16> value;
template <class C14> class nested {// ERROR - .* template <class C14> class nested {// { dg-error "" } .*
T16 value; T16 value;
public: public:
nested(): value( T16(0)) {} nested(): value( T16(0)) {}
...@@ -137,8 +137,8 @@ template <class T17, int i> struct Xtwenty { ...@@ -137,8 +137,8 @@ template <class T17, int i> struct Xtwenty {
// non-type template parameters v1: enum // non-type template parameters v1: enum
enum my_enum {my_A = 45, my_B, my_C}; enum my_enum {my_A = 45, my_B, my_C};
template <my_enum T18> class Xtwentyone {// ERROR - .* template <my_enum T18> class Xtwentyone {// { dg-error "" } .*
float T18; // ERROR - .* float T18; // { dg-error "" } .*
}; };
...@@ -149,30 +149,30 @@ struct base { ...@@ -149,30 +149,30 @@ struct base {
int ret_gcount() {return gcount;} int ret_gcount() {return gcount;}
}; };
template <class T20, base* b> class Xtwentytwo {// ERROR - .* template <class T20, base* b> class Xtwentytwo {// { dg-error "" } .*
float b; // ERROR - .* float b; // { dg-error "" } .*
}; };
// 23 // 23
// non-type template parameters v2: reference to object // non-type template parameters v2: reference to object
template <class T20, base& b2> class Xtwentythree {// ERROR - .* template <class T20, base& b2> class Xtwentythree {// { dg-error "" } .*
float b2; // ERROR - .* float b2; // { dg-error "" } .*
}; };
// 24 // 24
// non-type template parameters v3: pointer to member // non-type template parameters v3: pointer to member
template <class T20, int base::* b3> class Xtwentyfour {// ERROR - .* template <class T20, int base::* b3> class Xtwentyfour {// { dg-error "" } .*
float b3; // ERROR - .* float b3; // { dg-error "" } .*
}; };
// 25 // 25
// non-type template parms that use push_class_level // non-type template parms that use push_class_level
template <class T22> void f1() {// ERROR - .* template <class T22> void f1() {// { dg-error "" } .*
struct foo { struct foo {
enum T22 { un, du, toi }; // ERROR - .* enum T22 { un, du, toi }; // { dg-error "" } .*
}; };
} }
......
// { dg-do assemble }
// 980924 bkoz // 980924 bkoz
// just a quick test for export, to make sure we are warning for it. // just a quick test for export, to make sure we are warning for it.
// CHANGE ME when it's supported // CHANGE ME when it's supported
// Build don't link:
// 14 Templates // 14 Templates
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// 1 // 1
// template definition // template definition
export template <class T> // WARNING - export template <class T> // { dg-warning "" }
bool templ_one(T a) { bool templ_one(T a) {
if (a > 0) if (a > 0)
return true; return true;
...@@ -41,17 +41,17 @@ public: ...@@ -41,17 +41,17 @@ public:
template <class T2> bool compare_ge(T2 test); template <class T2> bool compare_ge(T2 test);
}; };
export template <class T> // WARNING - export template <class T> // { dg-warning "" }
const bool X_one<T>::is_specialized = false; const bool X_one<T>::is_specialized = false;
export template <class T> // WARNING - export template <class T> // { dg-warning "" }
unsigned short X_one<T>::ret_id() { unsigned short X_one<T>::ret_id() {
return id; return id;
} }
export template <class T2> // WARNING - export template <class T2> // { dg-warning "" }
bool compare_ge(T2 test) { bool compare_ge(T2 test) {
if (test > type) // ERROR - .* if (test > type) // { dg-error "" } .*
return true; return true;
return false; return false;
} }
......
// { dg-do run }
// 980945 bkoz // 980945 bkoz
// test for correct operators at link time // test for correct operators at link time
......
// { dg-do run }
template <class T> template <class T>
class Foo class Foo
......
// Build don't link: // { dg-do assemble }
//980205 bkoz //980205 bkoz
//7.1.3 the typedef specifier //7.1.3 the typedef specifier
...@@ -16,10 +16,10 @@ typedef int I; ...@@ -16,10 +16,10 @@ typedef int I;
typedef I I; typedef I I;
//p3--cannot redefine to a different type in a given scope //p3--cannot redefine to a different type in a given scope
class complex2 { /* ... */ };// ERROR - .* class complex2 { /* ... */ };// { dg-error "" } .*
typedef int complex2;// ERROR - .* typedef int complex2;// { dg-error "" } .*
typedef int complex3;// ERROR - .* typedef int complex3;// { dg-error "" } .*
class complex3 { /* ... */ };// ERROR - .* class complex3 { /* ... */ };// { dg-error "" } .*
//p4 //p4
...@@ -40,7 +40,7 @@ struct S { ...@@ -40,7 +40,7 @@ struct S {
typedef struct S T; typedef struct S T;
S a = T(); // OK S a = T(); // OK
struct T * p; // ERROR - using typedef after struct struct T * p; // { dg-error "" } using typedef after struct
//case01 //case01
typedef bool short;// ERROR - .* typedef bool short;// { dg-error "" } .*
// Build don't link: // { dg-do assemble }
//980526 bkoz //980526 bkoz
// reduced testcase for 980511 brendan qt bug // reduced testcase for 980511 brendan qt bug
......
// { dg-do run }
// 980617 bkoz // 980617 bkoz
// typeid for local types // typeid for local types
// typeid bool vs int and enum vs int // typeid bool vs int and enum vs int
......
// Build don't link: // { dg-do assemble }
// Special g++ Options: -Wall -Weffc++ // { dg-options "-Wall -Weffc++" }
//1 g++/12952 un-named variables in a catch block //1 g++/12952 un-named variables in a catch block
//Wall or Wunused should not give warnings here //Wall or Wunused should not give warnings here
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
virtual long retcntr() {return counter;}; virtual long retcntr() {return counter;};
Mutex2(int i = 0): counter(i) {}; Mutex2(int i = 0): counter(i) {};
virtual ~Mutex2() {}; virtual ~Mutex2() {};
} __attribute__ ((warn)); // WARNING - } __attribute__ ((warn)); // { dg-warning "" }
......
// { dg-do assemble }
// { dg-options "-Wredundant-decls" }
// 980413 bkoz // 980413 bkoz
// from g++/15307, tests for -Wredundant-decls // from g++/15307, tests for -Wredundant-decls
// for friend functions and functions // for friend functions and functions
// Build don't link:
//Special g++ Options: -Wredundant-decls
extern int foo(const char *); extern int foo(const char *);
...@@ -23,7 +23,7 @@ class B ...@@ -23,7 +23,7 @@ class B
class C class C
{ {
friend int foo(const char *); friend int foo(const char *);
friend int foo(const char *); // WARNING - friend int foo(const char *); // { dg-warning "" }
int foo2() {return b;} int foo2() {return b;}
int b; int b;
}; };
...@@ -32,7 +32,7 @@ class D ...@@ -32,7 +32,7 @@ class D
{ {
public: public:
int foo2() {return b;} int foo2() {return b;}
int foo2() {return b;} // ERROR - int foo2() {return b;} // { dg-error "" }
int b; int b;
}; };
...@@ -40,12 +40,12 @@ class E ...@@ -40,12 +40,12 @@ class E
{ {
public: public:
int foo2(); int foo2();
int foo2(); // ERROR - int foo2(); // { dg-error "" }
int b; int b;
}; };
extern int foo3(const char *); // WARNING - extern int foo3(const char *); // { dg-warning "" }
extern int foo3(const char *); // WARNING - extern int foo3(const char *); // { dg-warning "" }
......
// { dg-do assemble }
// { dg-options "-Wredundant-decls" }
// 980420 bkoz // 980420 bkoz
// from g++/15307, tests for -Wredundant-decls for decls // from g++/15307, tests for -Wredundant-decls for decls
// Build don't link:
// Special g++ Options: -Wredundant-decls
//shouldn't crash //shouldn't crash
extern unsigned char *foo5[]; extern unsigned char *foo5[];
......
// { dg-do assemble }
// { dg-options "-Wno-non-template-friend" }
// 980903 bkoz // 980903 bkoz
// make sure this option works // make sure this option works
// Build don't link:
// Special g++ Options: -Wno-non-template-friend
template<class T> class task { template<class T> class task {
......
// Build don't link: // { dg-do assemble }
char *stuff() { char *stuff() {
char array[10]; // WARNING - char array[10]; // { dg-warning "" }
return array; return array;
} }
// Build don't link: // { dg-do assemble }
extern const int a[]; extern const int a[];
extern const int a[]; extern const int a[];
extern const int a[]; extern const int a[];
// { dg-do assemble }
// prms-id: 9028 // prms-id: 9028
class Foo; class Foo;
...@@ -6,8 +7,8 @@ int main() ...@@ -6,8 +7,8 @@ int main()
int i=0; int i=0;
switch (i) switch (i)
{ {
case ((Foo *)0): // ERROR - case ((Foo *)0): // { dg-error "" }
case ((Foo *)1): // ERROR - case ((Foo *)1): // { dg-error "" }
break; break;
} }
} }
// Build don't link: // { dg-do assemble }
// prms-id: 9866 // prms-id: 9866
class TChar class TChar
{ {
......
// { dg-do run }
// prms-id: 7330 // prms-id: 7330
#include <stddef.h> #include <stddef.h>
int size = 0; int size = 0;
......
// Build don't link: // { dg-do assemble }
extern "C" { extern "C" {
class A { class A {
public: public:
......
// { dg-do assemble }
class C { class C {
public: public:
static friend int f(); // ERROR - static friend int f(); // { dg-error "" }
}; };
// { dg-do assemble }
// prms-id: 5274 // prms-id: 5274
class VHDLIdentifier; class VHDLIdentifier;
...@@ -11,6 +12,6 @@ extern void form(const char *format, ... ); ...@@ -11,6 +12,6 @@ extern void form(const char *format, ... );
int int
VHDLPackageProtoRep::thing() VHDLPackageProtoRep::thing()
{ {
form("package `%s'", (char *)actual_name()); // ERROR - can't convert from incomplete type form("package `%s'", (char *)actual_name()); // { dg-error "" } can't convert from incomplete type
return 0; return 0;
} }
// Build don't link: // { dg-do assemble }
class A { class A {
char str[10]; char str[10];
public: public:
...@@ -11,7 +11,7 @@ public: ...@@ -11,7 +11,7 @@ public:
class B : public A { class B : public A {
public: public:
char* m1 () { C::m1(); return ""; } // ERROR - char* m1 () { C::m1(); return ""; } // { dg-error "" }
}; };
int main () { int main () {
......
// Build don't link: // { dg-do assemble }
#include <stdlib.h> #include <stdlib.h>
class A { class A {
...@@ -6,7 +6,7 @@ public: ...@@ -6,7 +6,7 @@ public:
void z(); void z();
A(void) {} A(void) {}
private: private:
A(const A &) { abort(); } // ERROR - A(const A &) { abort(); } // { dg-error "" }
const A& operator =(const A &) { abort(); } const A& operator =(const A &) { abort(); }
}; };
...@@ -20,5 +20,5 @@ void f(B b) { ...@@ -20,5 +20,5 @@ void f(B b) {
void g() { void g() {
B h; B h;
f(h); // ERROR - f(h); // { dg-error "" }
} }
// Build don't link: // { dg-do assemble }
struct A { struct A {
struct B { struct B {
......
// { dg-do run }
int int
main() { main() {
struct s struct s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment