Bug 18451 - C++ error message regression
Summary: C++ error message regression
Status: RESOLVED DUPLICATE of bug 15946
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2004-11-12 14:05 UTC by sschunck
Modified: 2010-10-16 23:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sschunck 2004-11-12 14:05:12 UTC
The following erroneous code gives an error message I do not understand

file.cc:

      1 template < class T >
      2 class A
      3 {
      4 public:
      5   class B
      6     {
      7   public:
      8       B( int inVal ) :  m_i( inVal ) { }
      9       int m_i;
     10     };
     11   static B s;
     12 };
     13 
     14 template < class T > A<T>::B A<T>::s( 10 );



gives the following error message witch g++-3.4.3 -Wall -c file.cc

14: error: expected constructor, destructor, or type conversion before "A" 
14: error: expected `;' before "A"

I have difficulties in understancing the message

with g++-3.3.2 -Wall -c file.cc

14: warning: `A<T>::B' is implicitly a typename
14: warning: implicit typename is deprecated, please see the documentation for
details

This message seems much clearer to me
Comment 1 Andrew Pinski 2004-11-12 14:11:46 UTC

*** This bug has been marked as a duplicate of 15946 ***
Comment 2 Jason Merrill 2009-11-08 03:47:51 UTC
Subject: Bug 18451

Author: jason
Date: Sun Nov  8 03:47:36 2009
New Revision: 154006

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154006
Log:
	PR c++/18451
	PR c++/40738
	* cp-tree.h (cp_decl_specifier_seq): Add any_type_specifiers_p.
	* parser.c (cp_parser_single_declaration): Call
	cp_parser_parse_and_diagnose_invalid_type_name here, too.
	(cp_parser_parameter_declaration): And here.
	(cp_parser_parse_and_diagnose_invalid_type_name): Be
	less picky about declarator form.  Don't skip to
	the end of the block if	we're in a declarator.
	(cp_parser_decl_specifier_seq): Set any_type_specifiers_p.
	(cp_parser_simple_declaration): Check it.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_diagnose_invalid_type_name): Tweak error message.
	(cp_parser_expression_statement): Likewise.
	* decl2.c (grokfield): Mention decltype instead of typeof.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ex1.C
    trunk/gcc/testsuite/g++.dg/ext/typedef-init.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-class1.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-class10.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-class5.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-class7.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-temp-class1.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-temp-class4.C
    trunk/gcc/testsuite/g++.dg/lookup/hidden-temp-class7.C
    trunk/gcc/testsuite/g++.dg/lookup/strong-using-2.C
    trunk/gcc/testsuite/g++.dg/other/typedef1.C
    trunk/gcc/testsuite/g++.dg/parse/access10.C
    trunk/gcc/testsuite/g++.dg/parse/constructor1.C
    trunk/gcc/testsuite/g++.dg/parse/crash38.C
    trunk/gcc/testsuite/g++.dg/parse/error3.C
    trunk/gcc/testsuite/g++.dg/parse/error36.C
    trunk/gcc/testsuite/g++.dg/parse/typespec1.C
    trunk/gcc/testsuite/g++.dg/template/typedef5.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/typename3.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/typename4.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/typename6.C
    trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb94.C

Comment 3 John David Anglin 2010-10-16 23:01:00 UTC
Author: danglin
Date: Sat Oct 16 23:00:55 2010
New Revision: 165568

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165568
Log:
	Backport from mainline
	2010-09-06  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/45543
	* g++.dg/debug/dwarf2/typedef1.C: Expect just one
	DW_TAG_enumeration_type DIE.

	2010-09-04  Andreas Schwab  <schwab@linux-m68k.org>
	* g++.dg/debug/dwarf2/typedef1.C: Replace ".*" by "\[^\n\]*".

	2009-11-07  Jason Merrill  <jason@redhat.com>

	PR c++/18451
	PR c++/40738
	* g++.dg/other/typedef1.C: Update expected errors.

	2009-08-03  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR testsuite/40858
	* g++.dg/debug/dwarf2/typedef1.C: Also match assembler string used with
	.ascii.


Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/debug/dwarf2/typedef1.C