Closed Bug 1116236 Opened 5 years ago Closed 5 years ago

nsCSSFrameConstructor.cpp(4553) : error C2601: 'sNonScrollableBlockData' : local function definitions are illegal bustage with MSVC2012

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: RyanVM, Assigned: mats)

References

Details

Attachments

(1 file)

nsCSSFrameConstructor.cpp(4553) : error C2601: 'sNonScrollableBlockData' : local function definitions are illegal
        nsCSSFrameConstructor.cpp(4528): this line contains a '{' which has not yet been matched
nsCSSFrameConstructor.cpp(4555) : error C2059: syntax error : '{'
nsCSSFrameConstructor.cpp(4555) : error C2143: syntax error : missing ';' before '{'
nsCSSFrameConstructor.cpp(4555) : error C2143: syntax error : missing ';' before '}'
nsCSSFrameConstructor.cpp(4555) : error C2143: syntax error : missing ';' before ','
nsCSSFrameConstructor.cpp(4557) : error C2143: syntax error : missing ';' before '{'
nsCSSFrameConstructor.cpp(4557) : error C2059: syntax error : '{'
nsCSSFrameConstructor.cpp(4557) : error C2143: syntax error : missing ';' before ','
nsCSSFrameConstructor.cpp(4558) : error C2143: syntax error : missing ';' before '{'
nsCSSFrameConstructor.cpp(4559) : error C2059: syntax error : '{'
nsCSSFrameConstructor.cpp(4559) : error C2143: syntax error : missing ';' before '{'
nsCSSFrameConstructor.cpp(4559) : error C2143: syntax error : missing ';' before '}'
nsCSSFrameConstructor.cpp(4559) : error C2143: syntax error : missing ';' before ','
nsCSSFrameConstructor.cpp(4559) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Flags: needinfo?(mats)
This looks like a MSVC error. Is this only with recent MSVC? (on a local machine, I presume?)

Assuming so -- could you try adding an "=" character before the "{", at the end of this line:
> 4553     static const FrameConstructionData sNonScrollableBlockData[2][2] {
https://mxr.mozilla.org/mozilla-central/source/layout/base/nsCSSFrameConstructor.cpp#4553
?

(I think it is missing that "=", and it seems possible that's what's confusing MSVC here.)
Flags: needinfo?(ryanvm)
(In reply to Daniel Holbert [:dholbert] from comment #1)
> Is this only with recent MSVC? (on a local machine, I presume?)

Yes, with MSVC2012.

> Assuming so -- could you try adding an "=" character before the "{", at the
> end of this line:

Looks like that fixed it. At least, now I'm hitting bustage in the JS engine instead.
Flags: needinfo?(ryanvm)
Attachment #8542456 - Flags: review?(mats)
Assignee: nobody → dholbert
I just landed a typo fix before I saw your request:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b427c8bc6809
Flags: needinfo?(mats)
Comment on attachment 8542456 [details] [diff] [review]
fix v1: add missing "=

All the better. :)
Attachment #8542456 - Flags: review?(mats)
Assignee: dholbert → mats
Flags: in-testsuite-
I'm surprised that it even compiles without the '='.  Do you know why?
# cat test.cpp
static int x { 1 };
int main() {return 0;}

# clang++  test.cpp 
test.cpp:1:13: error: expected ';' after top level declarator
static int x { 1 };
            ^
            ;
1 error generated.

# clang++ -std=gnu++0x  test.cpp
#

We compile with -std=gnu++0x so that's why it was accepted I suppose.
https://hg.mozilla.org/mozilla-central/rev/b427c8bc6809
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.