Bug 6634 - wrong parsing of "long long double"
Summary: wrong parsing of "long long double"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.0.4
: P3 normal
Target Milestone: 4.2.0
Assignee: Volker Reichelt
URL:
Keywords: accepts-invalid, monitored
: 11200 32888 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-11 05:56 UTC by santugi
Modified: 2007-07-25 02:35 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-05 03:36:17


Attachments
bugtest2.C (30 bytes, text/plain)
2003-05-21 15:16 UTC, santugi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description santugi 2002-05-11 05:56:01 UTC
The inexistent type long long double is recognized by the compiler and treated as long long int. 

A long long double should either not exist or be a floating point type
having same or better precision than long double.

The code is one line long.

Release:
3.0.4

Environment:
FreeBSD 4.5 Release

How-To-Repeat:
compile the attached programm. It will print a warning about assigning a floating type litteral to an integer.

Th problem disappear with option --pedantic error since long long is 
recognized illegal with this option.
Comment 1 Kriang Lerdsuwanakij 2002-05-14 07:03:41 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.  Still present in 3.1 branch and trunk.
Comment 2 Andrew Pinski 2003-06-16 00:11:51 UTC
*** Bug 11200 has been marked as a duplicate of this bug. ***
Comment 3 Debian GCC Maintainers 2004-06-13 18:34:38 UTC
still present in 3.4 and 20040613 HEAD

[ was submitted as http://bugs.debian.org/247112 ]
Comment 4 Alan Modra 2004-11-30 10:00:51 UTC
Mainline is fixed.
pr6634.i:1: error: both 'long long' and 'double' in declaration specifiers

So is 3.4.4 and 3.3.2
pr6634.i:1: error: long or short specified with floating type for `a'
pr6634.i:1: error: the only valid combination is `long double'

Closing since all active branches are fixed.
Comment 5 jsm-csl@polyomino.org.uk 2004-11-30 11:24:46 UTC
Subject: Re:  wrong parsing of "long long double"

On Tue, 30 Nov 2004, amodra at bigpond dot net dot au wrote:

> Mainline is fixed.
> pr6634.i:1: error: both 'long long' and 'double' in declaration specifiers
> 
> So is 3.4.4 and 3.3.2
> pr6634.i:1: error: long or short specified with floating type for `a'
> pr6634.i:1: error: the only valid combination is `long double'
> 
> Closing since all active branches are fixed.

This is a C++ bug report.  Why are you closing it based on tests with the 
C compiler?

Comment 6 Volker Reichelt 2004-11-30 11:24:58 UTC
No this isn't fixed.
It works with the C frontend since 2.95.x, but not with the C++ frontend.
Comment 7 Volker Reichelt 2006-03-05 17:43:11 UTC
Mine.
Comment 8 patchapp@dberlin.org 2006-03-06 17:45:13 UTC
Subject: Bug number PR c++/6634

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-03/msg00334.html
Comment 9 Volker Reichelt 2006-03-15 15:27:46 UTC
Subject: Bug 6634

Author: reichelt
Date: Wed Mar 15 15:27:11 2006
New Revision: 112084

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112084
Log:
	PR c++/6634
	decl.c (grokdeclarator): Do not accept long long double.
	Reorganize checks for invalid (combinations of) type modifiers.
	Quote modifiers in messages.

	g++.dg/parse/long1.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/parse/long1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog

Comment 10 Volker Reichelt 2006-03-15 15:29:01 UTC
Fixed on mainline.
Comment 11 patchapp@dberlin.org 2006-07-31 22:35:28 UTC
Subject: Bug number PR c++/6634

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg01267.html
Comment 12 Volker Reichelt 2006-07-31 22:52:28 UTC
Subject: Bug 6634

Author: reichelt
Date: Mon Jul 31 22:52:20 2006
New Revision: 115843

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115843
Log:
	PR c++/6634
	* decl.c (grokdeclarator): Check whether "long" or "short" was
	specified for non-integral types.

	* g++.dg/parse/long1.C: Add more tests.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/long1.C

Comment 13 Andrew Pinski 2007-07-25 02:35:50 UTC
*** Bug 32888 has been marked as a duplicate of this bug. ***