aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2014-08-14 09:15:11 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2014-08-14 09:15:11 +0000
commit215acd2bae70e5ae9cbe68bdaa150a9215722310 (patch)
tree1e963461dfca0b26599e98b72119b3b4f1cef94c /gcc
parent35770bb20f9adb2f9687ab206cc2a0c53b5d6966 (diff)
downloadgcc-215acd2bae70e5ae9cbe68bdaa150a9215722310.zip
gcc-215acd2bae70e5ae9cbe68bdaa150a9215722310.tar.gz
gcc-215acd2bae70e5ae9cbe68bdaa150a9215722310.tar.bz2
parser.c (cp_parser_init_declarator): Remove redundant check of decl_specifiers->type.
/gcc/cp 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com> * parser.c (cp_parser_init_declarator): Remove redundant check of decl_specifiers->type. /gcc/testsuite 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/alias-decl-4.C: Adjust for parser change. * g++.dg/cpp0x/decltype2.C: Likewise. * g++.dg/cpp0x/decltype3.C: Likewise. * g++.dg/cpp0x/pr60249.C: Likewise. * g++.dg/cpp0x/variadic-ex10.C: Likewise. * g++.dg/cpp0x/variadic-ex14.C: Likewise. * g++.dg/cpp0x/variadic2.C: Likewise. * g++.dg/cpp0x/variadic74.C: Likewise. * g++.dg/parse/error10.C: Likewise. * g++.dg/parse/error15.C: Likewise. * g++.dg/parse/error2.C: Likewise. * g++.dg/template/crash106.C: Likewise. * g++.dg/template/crash89.C: Likewise. * g++.dg/template/nontype7.C: Likewise. * g++.dg/template/void3.C: Likewise. * g++.dg/template/void7.C: Likewise. /libstdc++-v3 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/26_numerics/random/linear_congruential_engine/ requirements/non_uint_neg.cc: Adjust for parser change. * testsuite/tr1/5_numerical_facilities/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. From-SVN: r213952
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c11
-rw-r--r--gcc/testsuite/ChangeLog19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype2.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr60249.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-ex10.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic2.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic74.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error10.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/error15.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/error2.C1
-rw-r--r--gcc/testsuite/g++.dg/template/crash106.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash89.C4
-rw-r--r--gcc/testsuite/g++.dg/template/nontype7.C3
-rw-r--r--gcc/testsuite/g++.dg/template/void3.C2
-rw-r--r--gcc/testsuite/g++.dg/template/void7.C2
19 files changed, 34 insertions, 39 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d4163b0..b5d748c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * parser.c (cp_parser_init_declarator): Remove redundant check of
+ decl_specifiers->type.
+
2014-08-13 Jason Merrill <jason@redhat.com>
* call.c (build_x_va_arg): Support passing non-POD through ....
@@ -5,7 +10,7 @@
2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
- * pt.c (lookup_template_variable): Make dependent variable templates
+ * pt.c (lookup_template_variable): Make dependent variable templates
have unknown type.
2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 4c04de7..ffb9538 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -16900,17 +16900,6 @@ cp_parser_init_declarator (cp_parser* parser,
possibly be looking at any other construct. */
cp_parser_commit_to_tentative_parse (parser);
- /* If the decl specifiers were bad, issue an error now that we're
- sure this was intended to be a declarator. Then continue
- declaring the variable(s), as int, to try to cut down on further
- errors. */
- if (decl_specifiers->any_specifiers_p
- && decl_specifiers->type == error_mark_node)
- {
- cp_parser_error (parser, "invalid type in declaration");
- decl_specifiers->type = integer_type_node;
- }
-
/* Enter the newly declared entry in the symbol table. If we're
processing a declaration in a class-specifier, we wait until
after processing the initializer. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 17e75e1..55dae55 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,22 @@
+2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/cpp0x/alias-decl-4.C: Adjust for parser change.
+ * g++.dg/cpp0x/decltype2.C: Likewise.
+ * g++.dg/cpp0x/decltype3.C: Likewise.
+ * g++.dg/cpp0x/pr60249.C: Likewise.
+ * g++.dg/cpp0x/variadic-ex10.C: Likewise.
+ * g++.dg/cpp0x/variadic-ex14.C: Likewise.
+ * g++.dg/cpp0x/variadic2.C: Likewise.
+ * g++.dg/cpp0x/variadic74.C: Likewise.
+ * g++.dg/parse/error10.C: Likewise.
+ * g++.dg/parse/error15.C: Likewise.
+ * g++.dg/parse/error2.C: Likewise.
+ * g++.dg/template/crash106.C: Likewise.
+ * g++.dg/template/crash89.C: Likewise.
+ * g++.dg/template/nontype7.C: Likewise.
+ * g++.dg/template/void3.C: Likewise.
+ * g++.dg/template/void7.C: Likewise.
+
2014-08-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/62090
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C
index 60edaf7..1232e19 100644
--- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-4.C
@@ -11,4 +11,4 @@ template <class T> using B = typename A<T>::U; // { dg-error "type" }
template <class T> struct A {
typedef B<T> U;
};
-B<short> b; // { dg-error "invalid type" }
+B<short> b;
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype2.C b/gcc/testsuite/g++.dg/cpp0x/decltype2.C
index f316f50..29ba2aa 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype2.C
@@ -45,7 +45,6 @@ int bar(int);
CHECK_DECLTYPE(decltype(foo), int(char));
decltype(bar) z; // { dg-error "overload" "overload" }
-// { dg-error "invalid type" "invalid" { target *-*-* } 47 }
CHECK_DECLTYPE(decltype(&foo), int(*)(char));
CHECK_DECLTYPE(decltype(*&foo), int(&)(char));
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype3.C b/gcc/testsuite/g++.dg/cpp0x/decltype3.C
index aaff5df..b2e6624 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype3.C
@@ -55,7 +55,7 @@ public:
CHECK_DECLTYPE(decltype(aa.*&A::a), int&);
decltype(aa.*&A::b) zz; // { dg-error "cannot create pointer to reference member" "cannot" }
-// { dg-error "invalid type" "invalid type" { target *-*-* } 57 }
+
CHECK_DECLTYPE(decltype(caa.*&A::a), const int&);
class X {
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr60249.C b/gcc/testsuite/g++.dg/cpp0x/pr60249.C
index e650dcb..35dd459 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr60249.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr60249.C
@@ -2,5 +2,3 @@
// { dg-do compile { target c++11 } }
decltype(""_) x; // { dg-error "unable to find string literal operator" }
-
-// { dg-error "invalid type in declaration before" "invalid" { target *-*-* } 4 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex10.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex10.C
index 740a45e..f4216a4 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex10.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex10.C
@@ -6,4 +6,3 @@ Tuple<int> t1; // Types contains one argument: int
Tuple<int, float> t2; // Types contains two arguments: int and float
Tuple<0> error; // { dg-error "mismatch" "mismatch" }
// { dg-message "expected a type" "expected a type" { target *-*-* } 7 }
-// { dg-error "in declaration" "in declaration" { target *-*-* } 7 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C
index 88c714e..e301e7a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex14.C
@@ -10,10 +10,8 @@ template<template<class...> class Q> class Y { /* ... */ };
X<A> xA; // okay
X<B> xB; // { dg-error "mismatch" "mismatch" }
// { dg-message "expected a template" "expected" { target *-*-* } 11 }
-// { dg-error "invalid type" "invalid" { target *-*-* } 11 }
X<C> xC; // { dg-error "mismatch" "mismatch" }
-// { dg-message "expected a template" "expected" { target *-*-* } 14 }
-// { dg-error "invalid type" "invalid" { target *-*-* } 14 }
+// { dg-message "expected a template" "expected" { target *-*-* } 13 }
Y<A> yA;
Y<B> yB;
Y<C> yC; // okay
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic2.C b/gcc/testsuite/g++.dg/cpp0x/variadic2.C
index 3d127ea..c1ca5e8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic2.C
@@ -9,7 +9,6 @@ template<typename T1, typename T2, typename... Rest>
struct two_or_more {}; // { dg-error "provided for" }
typedef two_or_more<int> bad; // { dg-error "2 or more" "2 or more" }
-// { dg-error "invalid type" "invalid type" { target *-*-* } 11 }
void f()
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic74.C b/gcc/testsuite/g++.dg/cpp0x/variadic74.C
index 1af6531..b86380b 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic74.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic74.C
@@ -20,9 +20,7 @@ A<int*, float*>::X<&i, &f> apple1;
B<int, float>::X<&i, &f> banana1;
A<int*, float*>::X<&i> apple2; // { dg-error "wrong number of template arguments" "wrong number" }
-// { dg-error "invalid type" "invalid" { target *-*-* } 22 }
A<int*, float*>::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" "wrong number" }
-// { dg-error "invalid type" "invalid" { target *-*-* } 24 }
A<int, float> apple4;
// { dg-prune-output "provided for" }
diff --git a/gcc/testsuite/g++.dg/parse/error10.C b/gcc/testsuite/g++.dg/parse/error10.C
index c2cd7e2..46c9eff 100644
--- a/gcc/testsuite/g++.dg/parse/error10.C
+++ b/gcc/testsuite/g++.dg/parse/error10.C
@@ -14,6 +14,4 @@ template <typename T> void foo()
enum typename A<T>::E e4;
}
-// Here, columns nums are not very accurate either. Still acceptable though
-// { dg-error "30:invalid type in declaration before ';' token" "invalid" { target *-*-* } 14 }
-// { dg-error "30:two or more data types in declaration of 'e4'" "2 or more" { target *-*-* } 14 }
+// { dg-error "28:two or more data types in declaration of 'e4'" "2 or more" { target *-*-* } 14 }
diff --git a/gcc/testsuite/g++.dg/parse/error15.C b/gcc/testsuite/g++.dg/parse/error15.C
index deba54a..be00241 100644
--- a/gcc/testsuite/g++.dg/parse/error15.C
+++ b/gcc/testsuite/g++.dg/parse/error15.C
@@ -16,7 +16,6 @@ N::C::INVALID f4; // { dg-error "7:'INVALID' in 'struct N::C' does not name
N::K f6; // { dg-error "4:'K' in namespace 'N' does not name a type" }
typename N::A f7;
// { dg-error "13:invalid use of template-name 'N::A' without an argument list" "13" { target *-*-* } 17 }
-// { dg-error "17:invalid type in declaration before ';' token" "17" { target *-*-* } 17 }
struct B
{
@@ -25,7 +24,7 @@ struct B
N::C::INVALID f4; // { dg-error "9:'INVALID' in 'struct N::C' does not name a type" }
N::K f6; // { dg-error "6:'K' in namespace 'N' does not name a type" }
typename N::A f7;
-// { dg-error "15:invalid use of template-name 'N::A' without an argument list" "15" { target *-*-* } 27 }
+// { dg-error "15:invalid use of template-name 'N::A' without an argument list" "15" { target *-*-* } 26 }
};
template <int>
diff --git a/gcc/testsuite/g++.dg/parse/error2.C b/gcc/testsuite/g++.dg/parse/error2.C
index 713957a..ac7a14c 100644
--- a/gcc/testsuite/g++.dg/parse/error2.C
+++ b/gcc/testsuite/g++.dg/parse/error2.C
@@ -12,4 +12,3 @@ Foo<func(g)> f; // { dg-error "5:'int func.double.' cannot appear in a constant-
// { dg-error "10:'g' cannot appear in a constant-expression" "g" { target *-*-* } 11 }
// { dg-error "11:a function call cannot appear in a constant-expression" "call" { target *-*-* } 11 }
// { dg-error "12:template argument 1 is invalid" "invalid template argument" { target *-*-* } 11 }
-// { dg-error "15:invalid type in declaration before ';' token" "invalid type" { target *-*-* } 11 }
diff --git a/gcc/testsuite/g++.dg/template/crash106.C b/gcc/testsuite/g++.dg/template/crash106.C
index ebd47bc..5bef101 100644
--- a/gcc/testsuite/g++.dg/template/crash106.C
+++ b/gcc/testsuite/g++.dg/template/crash106.C
@@ -9,6 +9,6 @@ struct A
template<T N = 0, void (A::*)() = &A::foo<N> > struct B {}; // { dg-error "type|declared" }
-B<> b; // { dg-error "type|declaration" }
+B<> b; // { dg-message "non-type" }
// { dg-prune-output "could not convert" }
diff --git a/gcc/testsuite/g++.dg/template/crash89.C b/gcc/testsuite/g++.dg/template/crash89.C
index f4cdaf9..d5c3a92 100644
--- a/gcc/testsuite/g++.dg/template/crash89.C
+++ b/gcc/testsuite/g++.dg/template/crash89.C
@@ -5,6 +5,4 @@ template<typename T, int = T()[0]> struct A // { dg-error "subscripted" }
typedef A<T> B;
};
-A<int> a; // { dg-error "declaration" }
-
-// { dg-prune-output "template argument 2 is invalid" }
+A<int> a; // { dg-error "template argument 2 is invalid" }
diff --git a/gcc/testsuite/g++.dg/template/nontype7.C b/gcc/testsuite/g++.dg/template/nontype7.C
index 5eac558..ba33b19 100644
--- a/gcc/testsuite/g++.dg/template/nontype7.C
+++ b/gcc/testsuite/g++.dg/template/nontype7.C
@@ -10,6 +10,3 @@ char p[] = "Vivisectionist";
X<int,"Studebaker"> x1; // { dg-error "string literal" }
X<int, p> x2;
-
-// { dg-bogus "" "additional errors" { xfail *-*-* } 11 }
-
diff --git a/gcc/testsuite/g++.dg/template/void3.C b/gcc/testsuite/g++.dg/template/void3.C
index bb59934..1124e44 100644
--- a/gcc/testsuite/g++.dg/template/void3.C
+++ b/gcc/testsuite/g++.dg/template/void3.C
@@ -1,5 +1,5 @@
//PR c++/28637
template<void> struct A {}; // { dg-error "not a valid type" }
-A<0> a; // { dg-error "type" }
+A<0> a; // { dg-message "non-type" }
diff --git a/gcc/testsuite/g++.dg/template/void7.C b/gcc/testsuite/g++.dg/template/void7.C
index 95d87a2..5edff9e 100644
--- a/gcc/testsuite/g++.dg/template/void7.C
+++ b/gcc/testsuite/g++.dg/template/void7.C
@@ -5,4 +5,4 @@ template<void> struct A // { dg-error "not a valid type" }
static int i;
};
-A<0> a; // { dg-error "invalid type|not a valid type" }
+A<0> a; // { dg-message "non-type" }