Last Comment Bug 661145 - always_inline incorrectly set when building with clang
: always_inline incorrectly set when building with clang
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla7
Assigned To: Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-01 07:10 PDT by Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
Modified: 2011-08-29 02:02 PDT (History)
3 users (show)
mounir: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.25 KB, patch)
2011-06-01 07:10 PDT, Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
benjamin: review-
Details | Diff | Splinter Review
move declarations out of main (4.66 KB, patch)
2011-06-01 11:32 PDT, Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
mh+mozilla: review+
Details | Diff | Splinter Review

Description Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2011-06-01 07:10:52 PDT
Created attachment 536604 [details] [diff] [review]
patch

AC_TRY_COMPILE expands into main with the user provide code in it. In this case, it looks like

int main(void) {
inline void f(void) __attribute__((always_inline));
}

This fails with

test.cc:2:1: error: inline declaration of 'f' not allowed in block scope
inline void f(void) __attribute__((always_inline));
^~~~~~
1 error generated.
Comment 1 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2011-06-01 07:21:17 PDT
Comment on attachment 536604 [details] [diff] [review]
patch

Why not just move the declaration into the first block of AC_TRY_COMPILE where it belongs?
Comment 2 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2011-06-01 11:32:58 PDT
Created attachment 536677 [details] [diff] [review]
move declarations out of main
Comment 4 Mounir Lamouri (:mounir) 2011-06-05 06:39:53 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/385822ac7499
Comment 5 Simona B [:simonab] 2011-08-29 02:02:30 PDT
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0

I visually inspected the code changes. Marking as Verified Fixed as per bug 659997 Comment 7.

Note You need to log in before you can comment on or make changes to this bug.