[Bug c++/28179] New: No diag for dflt arg on out-of-line tmpl member func def

2006-06-27 Thread cbowler at ca dot ibm dot com
t.C:

template
struct S  {
  void dump(char *);
};

template
void S::dump(char *m = 0) {}

void foo() { S<0> s; }


>From the standard:

8.3.6 paragraph 6:

... "Default arguments for a member function of a class template
shall be specified on the initial declaration of the member function within the
class template."

This error is not diagnosed in any version of g++ that I've tried.  I request
that g++ implement this diagnostic to help users write standard compliant code.


-- 
   Summary: No diag for dflt arg on out-of-line tmpl member func def
   Product: gcc
   Version: 3.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cbowler at ca dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28179



[Bug c/28679] New: #pragma pack(push) malformed

2006-08-10 Thread cbowler at ca dot ibm dot com
5.47.6 Structure-Packing Pragmas

3. #pragma pack(push[,n]) pushes the current alignment setting on an internal
stack and then optionally sets the new alignment.

t.c:
#pragma pack(1)
#pragma pack(push)

gcc t.c
t.c:2: warning: malformed '#pragma pack(push[, id], )' - ignored

It appears #pragma pack(push) is not supported as the documention suggests.  

Also, the error message indicates there is an undocumented form or #pragma pack
that takes a stack identifier.  I've been poking around to understand how it
works but I'm not sure what #pragma pack(pop) does.  It appears to pop all
stacks, but what packing is set afterwards if multiple stacks are popped?


-- 
   Summary: #pragma pack(push) malformed
   Product: gcc
   Version: 3.4.4
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: cbowler at ca dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28679



[Bug c/28679] #pragma pack(push) malformed

2006-08-16 Thread cbowler at ca dot ibm dot com


--- Comment #2 from cbowler at ca dot ibm dot com  2006-08-16 12:47 ---
While fixed in 4.0.0, the manual does not document the form of pragma pack with
stack identifiers.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28679



[Bug c/24332] New: asm label declaration may be missing aliasing info

2005-10-12 Thread cbowler at ca dot ibm dot com
sparky% gcc -v
Reading specs from
/.../torolab.ibm.com/fs/projects/vabld/run/gcc/aix/gcc-3.3.2/aix52/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --disable-nls
Thread model: aix
gcc version 3.3.2

t.c:

int j asm("i");
int i;

int main() {
  i = 5;
  j = 6;
  int k = i;
  j = 7;
  return k;
}

sparky% gcc t.c
sparky% a.out
sparky% echo $?
6
sparky% gcc t.c -O
sparky% a.out
sparky% echo $?
5

In the opt case I expect a result of 6.

The problem, I suspect, is that the compiler is not aliasing 'i' and 'j' to
each other for the optimizer.  The write 'j=6' appears dead in this case, and
the optimizer is likely to remove it.

You may consider this user error, however, the compiler is able to detect this
problem because it knows 'i' and 'j' have the same symbol name.  Consequently I
suggest either an error diagnostic be issued, or the symbols should be aliased
together for the optimizer.


-- 
   Summary: asm label declaration may be missing aliasing info
   Product: gcc
   Version: 3.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cbowler at ca dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24332