public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41786]  New: misparsing an object declaration - parameter may not have variably modified type
@ 2009-10-21 19:42 jarausch at igpm dot rwth-aachen dot de
  2009-10-21 19:49 ` [Bug c++/41786] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jarausch at igpm dot rwth-aachen dot de @ 2009-10-21 19:42 UTC (permalink / raw)
  To: gcc-bugs

The declaration 
form proj (space(V[i]), V_new_i, "mass");
of an object 'proj' of class 'form' is not recognized,
see below

#include <vector>
using std::vector;
#include <string>

struct space_component;
struct const_space_component;

template <class T>
class smart_pointer {
public:

// allocators:

        smart_pointer (T* p = 0);
        smart_pointer (const smart_pointer&);
        ~smart_pointer ();
        smart_pointer& operator= (const smart_pointer&);

// accessors:

        const T* pointer    () const;
        const T& data       () const;
        const T* operator-> () const;
        const T& operator*  () const;

// modifiers:

        T* pointer ();
        T* operator-> ();
        T& data ();
        T& operator* ();

// implementation:

};

typedef int basis;

class spacerep {
public:
  typedef std::vector<basis>::size_type  size_type;
  spacerep();
};


class space : public smart_pointer<spacerep> {
public:
// typdefs:

    typedef spacerep::size_type size_type;

// allocator/deallocator:

    space ();
    space(const const_space_component&);

    space_component operator [] (size_type i_comp);
    const_space_component operator [] (size_type i_comp) const;
};

struct space_component {
    typedef space::size_type size_type;
    space_component();
    space_component(space& V, size_type i);
};
struct const_space_component {
    typedef space::size_type size_type;
    const_space_component();
    const_space_component(const space_component&);
};

class form {
public :
    form ();
    form (const space& X, const space& Y, const std::string& op_name, 
        bool locked_boundaries=false);

};

int main() {
            space V, V_new_i;
            int i=1;
            form proj (space(V[i]), V_new_i, "mass");
/* error: parameter may not have variably modified type 
  'space [(((long unsigned int)(((long int)i) + -0x00000000000000001)) + 1)]'
*/

}


-- 
           Summary: misparsing an object declaration - parameter may not
                    have variably modified type
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jarausch at igpm dot rwth-aachen dot de
 GCC build triplet: x86-64
  GCC host triplet: x86-64
GCC target triplet: x86-64


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-03-30 21:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 19:42 [Bug c++/41786] New: misparsing an object declaration - parameter may not have variably modified type jarausch at igpm dot rwth-aachen dot de
2009-10-21 19:49 ` [Bug c++/41786] " pinskia at gcc dot gnu dot org
2009-10-22 10:35 ` jarausch at igpm dot rwth-aachen dot de
2010-03-09 22:33 ` [Bug c++/41786] [4.4/4.5 regression] " jason at gcc dot gnu dot org
2010-03-09 22:33 ` jason at gcc dot gnu dot org
2010-03-09 22:43 ` pinskia at gcc dot gnu dot org
2010-03-10 16:24 ` rguenth at gcc dot gnu dot org
2010-03-30 21:20 ` jason at gcc dot gnu dot org
2010-03-30 21:21 ` jason at gcc dot gnu dot org
2010-03-30 21:23 ` jason at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).