Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-955 Fix template expansion
  3. QTCREATORBUG-1610

Using enum as template parameter is marked as error

    XMLWordPrintable

Details

    Description

      Consider the following code:

      enum Codes {
      	kCode1,
      	kCode2
      };
      
      template<Codes Code>
      class Coder {
      	int code() const { return Code; }
      };
      
      Coder<kCode1>	k;
      

      The above code compiles OK. But the definition of k causes the editor to hilite the line as error with message "kCode1 is not a type name" while the template calls for a non-typename parameter.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            stephenju Stephen Chu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes