Enum type doesn't compile unless I provide function prototype

This code doesn't compile - I get:
test_prog:16:13: error: variable or field 'LCDcmd' declared void
void LCDcmd(LCDcmd_t cmd, int row, int column) {
test_prog:16:13: error: 'LCDcmd_t' was not declared in this scope

const int MY_LED = 8;

void setup() {
  Serial.begin(9600);
  delay(1000);
  pinMode(MY_LED, OUTPUT);
}

enum LCDcmd_t {
   lcd_clear,lcd_home,lcd_gotoxy,lcd_cursor_off,lcd_cursor_on
};



void LCDcmd(LCDcmd_t cmd, int row, int column) {
// For NHD brand serial displays
// column 0..15, row 0..1
  switch(cmd) {
    case lcd_clear:  
    Serial.write(0xFE);  Serial.write(0x51); delay(500);
    break;
    case lcd_home:   
    Serial.write(0xFE);  Serial.write(0x46); delay(100);
    break;
    case lcd_gotoxy: 
    Serial.write(0xFE);  Serial.write(0x45);  Serial.write(byte(row * 0x40 + column));
        delay(100);
    break;
    case lcd_cursor_off:
        Serial.write(0xFE);  Serial.write(0x4C); // blinking cursor off
        delay(50);
        Serial.write(0xFE);  Serial.write(0x48); // underline cursor off
        delay(50);
    break;
    case lcd_cursor_on:
        Serial.write(0xFE);  Serial.write(0x4B); // blinking cursor on
        delay(50);
    break;
    }
} //end LCDcmd;

void loop () {
    digitalWrite(MY_LED, true);
		delay(500);
    digitalWrite(MY_LED, false);
    delay(500);
}

However, if I add the function prototype for LCDcmd before the actual LCDcmd function, it compiles fine.

const int MY_LED = 8;

void setup() {
  Serial.begin(9600);
  delay(1000);
  pinMode(MY_LED, OUTPUT);
}

enum LCDcmd_t {
   lcd_clear,lcd_home,lcd_gotoxy,lcd_cursor_off,lcd_cursor_on
};

void LCDcmd(LCDcmd_t cmd, int row, int column);

void LCDcmd(LCDcmd_t cmd, int row, int column) {
// For NHD brand serial displays
// column 0..15, row 0..1
  switch(cmd) {
    case lcd_clear:  
    Serial.write(0xFE);  Serial.write(0x51); delay(500);
    break;
    case lcd_home:   
    Serial.write(0xFE);  Serial.write(0x46); delay(100);
    break;
    case lcd_gotoxy: 
    Serial.write(0xFE);  Serial.write(0x45);  Serial.write(byte(row * 0x40 + column));
        delay(100);
    break;
    case lcd_cursor_off:
        Serial.write(0xFE);  Serial.write(0x4C); // blinking cursor off
        delay(50);
        Serial.write(0xFE);  Serial.write(0x48); // underline cursor off
        delay(50);
    break;
    case lcd_cursor_on:
        Serial.write(0xFE);  Serial.write(0x4B); // blinking cursor on
        delay(50);
    break;
    }
} //end LCDcmd;

void loop () {
    digitalWrite(MY_LED, true);
		delay(500);
    digitalWrite(MY_LED, false);
    delay(500);
}

What's going on? Looks to me like the first version should be fine, with the C++ method of using enum.

If no function prototype is provided, the IDE will generate one for you. Guess where it places it? That's right, before your enum declaration.

The compiler can't parse the Arduino magic prototype because it doesn't (yet) know the argument type "LCDcmd_t".

void LCDcmd(LCDcmd_t, int, int);

I think it will compile without error if you add the keyword 'enum' to the declaration:

void LCDcmd(enum LCDcmd_t cmd, int row, int column) {

Then, when the Arduino magic prototype is generated, the compiler knows what you mean:

void LCDcmd(enum, int, int);

@Johnwasser,
Adding enum doesn't fix the compilation - I get a different error:
test_prog:16:18: error: use of enum 'LCDcmd_t' without previous declaration
void LCDcmd(enum LCDcmd_t cmd, int row, int column) {

So for now I'm going with the function prototype.

I'm confused by this - I thought that under C++ an enum definition creates a fully-qualified type, but the compiler doesn't handle it like that. Also, why would the compiler not complain about LCDcmd_t in the function prototype? What is different about a prototype?

What is different about a prototype?

Fundamentally, nothing. It is all about WHERE the prototype is placed. You placed yours (properly) after the enum statement. The IDE, if it added one at all, put it before the enum statement.