Bug 34962 - [4.2 regression] ICE with VLA and attribute in template
Summary: [4.2 regression] ICE with VLA and attribute in template
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.3.0
Assignee: Jason Merrill
URL:
Keywords: ice-checking, ice-on-valid-code, monitored
Depends on:
Blocks: C++VLA
  Show dependency treegraph
 
Reported: 2008-01-25 00:40 UTC by Volker Reichelt
Modified: 2016-03-04 04:02 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.6
Known to fail: 4.0.4 4.1.2 4.2.3
Last reconfirmed: 2008-02-13 18:19:05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-01-25 00:40:32 UTC
The following invalid code snippet triggers an ICE since GCC 4.0.0:

=================================================================
struct A
{
  static const int i;
};

template<int> void foo()
{
  int x[A::i] __attribute((vector_size(8)));
}
=================================================================

bug.cc: In function 'void foo()':
bug.cc:8: internal compiler error: tree check: did not expect class 'type', have 'type' (record_type) in contains_placeholder_p, at tree.c:2267
Please submit a full bug report, [etc.]

This is related to PR34913, but not yet fixed.
Comment 1 Richard Biener 2008-01-25 09:56:32 UTC
P2 as we likely do sth bogus when we not ICE (with checking disabled).
Comment 2 Richard Biener 2008-01-26 17:15:58 UTC
Also related to PR28879
Comment 3 Jason Merrill 2008-02-13 21:28:02 UTC
Subject: Bug 34962

Author: jason
Date: Wed Feb 13 21:27:16 2008
New Revision: 132297

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132297
Log:
        PR c++/34962, c++/34937, c++/34939
        * decl2.c (is_late_template_attribute): Always defer attributes
        vector_size and weak.

Added:
    trunk/gcc/testsuite/g++.dg/ext/tmplattr9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c

Comment 4 Joseph S. Myers 2008-07-04 22:31:37 UTC
Closing 4.1 branch.
Comment 5 Jason Merrill 2008-12-02 17:09:11 UTC
Fixed in 4.3.