Commit 8e54705d by Robert Lipe

Another round of improvements from Martin.

From-SVN: r20166
parent d73365c5
// Build don't link:
#define NO_META_MAX
#ifndef NO_META_MAX
template<int N1, int N2>
struct meta_max {
enum { max = (N1 > N2) ? N1 : N2 };
};
#endif
struct X {
enum {
......
......@@ -4,5 +4,5 @@ class C { };
void foo()
{
C c;
void * v = static_cast<void *>(c);
void * v = static_cast<void *>(c); // ERROR - illegal cast
}
//Special g++ Options:
//This uses GNU extensions, so disable -ansi
#include <stdio.h>
class A {
......
// Build don't link:
/*
/*
Check whether a typedef for a basic type as a baseclass is diagnosed.
*/
typedef int an_int;
class bar : public an_int {}; // ERROR -
class bar : public an_int {}; // ERROR - not an aggregate
......@@ -18,7 +18,7 @@ friend class D;
class D {
int ins( B*&);
};
}; //WARNING - only private members
int
D::ins( B*& tempN)
......
......@@ -7,7 +7,7 @@ inline bool operator!=(const T& x, const T& y) {
enum T {
V1,
}; // ERROR -
}; //ERROR - comma at end of enumerator list
struct X {
T t : 31;
......
class foo {
public:
operator <<(const void *);
operator <<(char *);
operator <<(const void *); //ERROR - no return type
operator <<(char *); //ERROR - no return type
};
void main()
{
{ //ERROR - wrong return type for main
foo f;
f << (void*)0;
}
......
......@@ -2,7 +2,7 @@
template <int n1>
double val <int> ()
{
{ // ERROR - bogus code
return (double) n1;
};
......
......@@ -2,5 +2,5 @@ template <unsigned X, class T> struct Foo {
friend void operator<<(int, Foo const &) {}
};
template <unsigned X> class Bar : public Foo<X,int> {};
inline Bar<0> bar(int,int,int) { return Bar<3>(); }
inline Bar<0> bar(int,int,int) { return Bar<3>(); } // ERROR - no conversion
template<int N> f<0>(){}
template<int N> f<0>(){} // ERROR - invalid code
......@@ -26,5 +26,5 @@ inline double Sine()
int main()
{
double f=Sine<32,5>()
return 0;
return 0; // ERROR - parse error
}
......@@ -12,4 +12,4 @@ private:
static int variable; // this is intentionally duplicated
};
myClass::variable = 0;
myClass::variable = 0; //ERROR - no type
......@@ -13,5 +13,5 @@
void f()
{
extent(b);
extent(b); // ERROR - no matching function
}
......@@ -128,7 +128,7 @@ class Baz : public ref_counted {
class Bar;
void main() {
int main() {
ref_ptr<Baz> foo;
static_cast<Bar *> (foo)->DoSomething;
static_cast<Bar *> (foo)->DoSomething; //ERROR - invalid cast
}
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