Bug 15333 - Bogus warning: statement has no effect (regression)
Summary: Bogus warning: statement has no effect (regression)
Status: RESOLVED DUPLICATE of bug 15083
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-06 23:21 UTC by Óscar Fuentes
Modified: 2005-07-23 22:49 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 Óscar Fuentes 2004-05-06 23:21:03 UTC
I'm seeing hundreds of warnings like this on a project that uses the idiom of 
self-registering objects.

It only happens if the constructor is a template.

This is a regression wrt previous gcc releases.

// Test case begins

class B {
public:
  B();  // Implemented elsewhere
};


class A {
public:
  template <typename T1>
  A(T1) {
    new B;
  }
};


A a(10);

// Test case ends

t:/sec/exp # g++ -c -Wall p.cpp 
p.cpp: In constructor `A::A(T1)':
p.cpp:11: warning: statement has no effect
Comment 1 Andrew Pinski 2004-05-06 23:23:29 UTC
This is a dup of bug 15083.

*** This bug has been marked as a duplicate of 15083 ***